problem with automatically complete orders
-
I have implemented following code to set all my orders except bacs to complete after ordering:
add_action( 'woocommerce_thankyou', 'custom_woocommerce_auto_complete_order' ); function custom_woocommerce_auto_complete_order( $order_id ) { if ( ! $order_id ) { return; } $order = wc_get_order( $order_id ); if($order->get_payment_method() == 'bacs'){ $order->update_status( 'processing' ); }else{ $order->update_status( 'completed' ); } }
But at my recent 2 orders (which aren’nt bacs), the status is still “processing”. but I can’t figure out why?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘problem with automatically complete orders’ is closed to new replies.