Update order status from processed to complete automatically
-
Hi,
I need updating order status from processing to completed automatically, I used snippet code/** * Auto Complete all WooCommerce orders. */ 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 ); $order->update_status( 'completed' ); }
The order updated successfully from processing to completed automatically but return to processing again ?!
N.B—> when users pay through myCred the order status update from processing to complete automatically, the problem appears when paying through payment gateway.
N.B—> My website works through the integration between learnpress and woocommerce.
What am I miss, please?!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Update order status from processed to complete automatically’ is closed to new replies.