3.4.After every order (Action)
Run an action after every successful completed order
wppizza_on_order_execute
if you want run an action (i.e your own function/plugin) after an order has been successfully completed, you can hook into wppizza_on_order_execute
@param: int
@param: array (formatted array of order details)
@param: array (an array of print templates output as set in WPPizza ->Templates print can be added to be available as 3rd parameter in the action hook – see below)
@return: void
example:
add_action('wppizza_on_order_execute', 'my_prefix_my_action', 10, 3);
function my_prefix_my_action($order_id, $order_details, $print_templates){
/*
do something that happens after
each order has bee completed
*/
}
wppizza_on_order_execute_get_print_templates_by_id
if also want to have the output of a print template available in the function of the above action add the relevant id’s like so
add_filter('wppizza_on_order_execute_get_print_templates_by_id', 'my_prefix_my_filter');
function my_prefix_my_filter($template_ids){
/*
add details of a template id defined in WPPizza -> Templates -> Print
for it to be available in subsequent wppizza_on_order_execute action hook as 3rd parameter
*/
$template_ids[] = 3;/* get details of print template with id 3 */
return $template_ids;
}
documentor id 5