Update 2 Only For Woocommerce 3+ (added restriction to execute the code only once). add_action('woocommerce_thankyou', 'enroll_student' ...
[This thread is closed.] Hi all, I need to catch the order creation but I have some problems: 1) if I add woocommerce_new_order hook, and I retrieve…
You can use woocommerce_new_order hook: add_action(' woocommerce_new_order', function ($order_id) { // your code }, 10, 1);.
Add a new field to the checkout; Add that new field to the order.
Try woocommerce_thankyou hook. This will trigger after recieving order successfully, no matter how user made payment. $hook_to = ' woocommerce_thankyou' ...
WooCommerce Code Reference
Stumbled on this looking for the same thing which I've now figured out ( Woocommerce 3.x)... add_filter( ...
However, before a payment is made and after a checkout is place, an order is created. This hook is often ignored and not mention around. And this is the ...
How to Hook Into WooCommerce to Trigger Something After an Order is Placed - Andy Sozot.
As it was mentioned above hooks enable the creation of independent plugins and