vapvarun icon

Process order to processing from hold - WooCommerce

vapvarun | PRO | 06/09/21 07:22:06 AM UTC | 0 ⭐ | 1542 👁️ | Never ⏰ | []
PHP |

380 B

|

None

|

0 👍

/

0 👎

 
add_action( 'woocommerce_thankyou', 'woocommerce_auto_processing_orders');
function woocommerce_auto_processing_orders( $order_id ) {
    if ( ! $order_id )
        return;
 
    $order = wc_get_order( $order_id );
 
    // If order is "on-hold" update status to "processing"
    if( $order->has_status( 'on-hold' ) ) {
        $order->update_status( 'processing' );
    }
}

Comments