I am looking for a hook which will be triggered after someone submit checkout form and order placed ( no matter he made the payment or not ) .
I tried woocommerce_new_order
But it’s not working.
I am looking for a hook which will be triggered after someone submit checkout form and order placed ( no matter he made the payment or not ) .
I tried woocommerce_new_order
But it’s not working.
Try woocommerce_thankyou
hook. This will trigger after recieving order successfully, no matter how user made payment.
$hook_to = 'woocommerce_thankyou';
$what_to_hook = 'wl8OrderPlacedTriggerSomething';
$prioriy = 111;
$num_of_arg = 1;
add_action($hook_to, $what_to_hook, $prioriy, $num_of_arg);
function wl8OrderPlacedTriggerSomething($order_id){
//do something...
}
For more reference dig into woocommerce/templates/checkout/thankyou.php