Prevent orders from processing automatically
-
My credit card gateway automatically captures the payment when the order is placed. By default, WooCommerce then marks the order as Processing. I need to prevent it from skipping over On Hold due to our order workflow. How can you prevent WooCommerce from automatically going to Processing (so the order is received, payment captured, but the order status stays at On Hold)? I tried the snippet below but that results in the order updating to Payment Pending instead of On Hold:
add_action( ‘woocommerce_thankyou’, ‘stop_auto_complete_order’ );
function stop_auto_complete_order( $order_id ) {
if ( ! $order_id ) {
return;
}$order = wc_get_order( $order_id );
$order->update_status( ‘on_hold’ );
}
- The topic ‘Prevent orders from processing automatically’ is closed to new replies.