I corrected the slug but the order still goes to Processing before being changed back to On Hold. This creates a problem because the temporary Processing status triggers our order processing email to be sent. This email notifies the customer that their order is ready for pickup when it has only been received. Can we adjust the function I provided previously to prevent this intermediate step?
I was able to prevent this from happening with Cash on Delivery orders using the following function:
// change COD payment method order status from processing to on-hold
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’;
}
Is it possible to adapt this to my Elavon CC gateway or to have it apply to ALL orders/payment gateways?