Advertisement
vapvarun

Process order to processing from hold - WooCommerce

Jun 9th, 2021
1,203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.38 KB | None | 0 0
  1.  
  2. add_action( 'woocommerce_thankyou', 'woocommerce_auto_processing_orders');
  3. function woocommerce_auto_processing_orders( $order_id ) {
  4.     if ( ! $order_id )
  5.         return;
  6.  
  7.     $order = wc_get_order( $order_id );
  8.  
  9.     // If order is "on-hold" update status to "processing"
  10.     if( $order->has_status( 'on-hold' ) ) {
  11.         $order->update_status( 'processing' );
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement