Default cash on delivery status
-
Hi,
I need the defaut order status for cash on delivery changed from “processing” to “pending”. I have tried thisadd_action( 'woocommerce_thankyou', 'my_order_status', 50 ); function my_order_status( $order_id ) { if ( ! $order_id ) { return; } $order = wc_get_order( $order_id ); if ( ( get_post_meta( $order->id, '_payment_method', true ) == 'cod' ) && ( $order->status == 'processing' ) ) { $order->update_status('on-hold'); } }
but it did not work. Does anyone know how to achieve this?
Thanks.
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Default cash on delivery status’ is closed to new replies.