The problem:
Need COD orders to be set to 'on-hold' instead of going straight to 'processing'.
What I've tried:
Using woocommerce_cod_process_payment_order_status hook to set the status but it doesn't seem to work and I haven't found anyone online that's managed to get it to work (within the last 3 years).
Similar Stack Overflow Question:
Change COD default order status to "On Hold" instead of "Processing" in Woocommerce
This question has a solution that no-longer works. Yes, same question, but since then things have changed.
What I've settled on (for now):
For the moment, I've settled on using the following code that sets ALL orders to 'on-hold'. But this is very annoying.
add_filter( 'woocommerce_payment_complete_order_status', 'change_order_status', 10, 2 );
function change_order_status( $order_status, $order ) {
return 'on-hold';
}
Incase you want to know why?
I'm using COD as a "quote request" feature. Products set to $0 are automatically registered as a "quote" not an "order". So when these COD orders come in, I want to be able to set and modify pricing before marking it as processing/awaiting-payment.