Set new orders to be on hold in WooCommerce

Set new orders to be on hold in WooCommerce on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_action( 'woocommerce_checkout_create_order', 'force_new_order_status', 20, 1 );
function force_new_order_status( $order ) {

    if( ! $order->has_status('on-hold') )
        $order->set_status( 'on-hold', 'Forced status by a custom script' );
}
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.