You can var_dump the order and check what fields you get in order. add_action( ' woocommerce_order_status_completed', 'my_function' ,10 ...
In that scenario, you can “get” the order object with the wc_get_order
Update 2 Only For Woocommerce 3+ (added restriction to execute the code only once). add_action('woocommerce_thankyou', 'enroll_student' ...
WooCommerce Get Order Details After Checkout · $order = new WC_Order( $ order_id ); · $items = $order->get_items(); · foreach ( $items as $key ...
I love WordPress, WooCommerce and Gutenberg so much. 12 yrs of experience. Need some custom developer help? Get in touch. Comments — 5.
You have a WooCommerce store, and you're getting orders… If your products are 'set and forget' and guaranteed error-proof during order processing, then ...
Below is the custom page shown after placing an order: Customize WooCommerce
“Checkbox” add-on values will display as “Yes” or “No”.
For this three possibilities: If you really want to do it on order place you would have to use the hook: woocommerce_new_order. However I ...
Let's add a new field to checkout, after the order notes, by hooking into the