• Resolved zacvasiliki

    (@zacvasiliki)


    Hi everyone,

    I would like to ask.
    Is there any way I can automatically make every new Woocommerce order’s status on hold?

    Paypal and Visa card payments is getting automatically “processing” status but I don’t want that. I would like all my new orders getting order status “On Hold” and getting on hold email

    I have found the following code which I add it on function child theme and is working fine but there is a small problem.
    The customer still getting proccessing status email instead of getting “On hold” email.

    /**
    * Auto On hold all WooCommerce orders.
    */
    function custom_woocommerce_auto_complete_order( $order_id ) {
        if ( ! $order_id ) {
            return;
        }
    
        $order = wc_get_order( $order_id );
        if( 'processing'== $order->get_status() ) {
            $order->update_status( 'on-hold' );
        }
    }
    add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' );

    Is there anyway that I can edit this code and customer get the “On hold” email instead of processing email?

    Please let me know if someone can help me.

    Thank You!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set new order’s status automatically in hold and send on hold email!’ is closed to new replies.