2 years ago

#61811

test-img

Alex Lag

Set Woocommerce new orders to "On hold" and send "on hold" email

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!

wordpress

woocommerce

hook-woocommerce

checkout

orders

0 Answers

Your Answer

Accepted video resources