• Resolved Soulstudio

    (@soulstudio)


    I’m using this code in my functions.php file:

    function custom_woocommerce_order($order_id) {
        if (!$order_id) {
            return;
        }
    
        $order = wc_get_order($order_id);
        $order->update_status('processing');
    }
    
    add_action('woocommerce_new_order', 'custom_woocommerce_order');

    This code is working but it prevents new order email notifications from displaying ordered items. Is this a bug or is it supposed to work like that?

    • This topic was modified 6 years, 7 months ago by Soulstudio.
    • This topic was modified 6 years, 7 months ago by Soulstudio.
    • This topic was modified 6 years, 7 months ago by Soulstudio.
Viewing 1 replies (of 1 total)
  • Thread Starter Soulstudio

    (@soulstudio)

    Solution was to use “woocommerce_checkout_order_processed” instead of “woocommerce_new_order”. ??

Viewing 1 replies (of 1 total)
  • The topic ‘Question regarding “woocommerce_new_order” hook’ is closed to new replies.