How to add order in processing if user is returning using?

Question

I have enabled the "Cash on Delivery" payment method in Woocommerce and added custom Order Status “COD” in Woocommerce. I have been using the following code to move orders to "COD" if the user selected the "COD" payment option.

add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10, 2 );
function change_cod_payment_order_status( $order_status, $order ) {
return 'on-hold';
}

Now coming to the point, I want that if the user is a returning user and is placing an order again, the order should not be moved to "COD" Status. It should remain in processing.

Is this possible?

0
Sillypeople12 3 weeks 0 Answers 4 views 0

Leave an answer