If you pay an order with cash on delivery (payment gateway cod), woocommerce set the order as "on-hold" status. I need to set the status for new orders as "pending".
Anyone can help me?
Thanks in advance.
Manuel
this code will help you put yout logic and changes in the function
<?php add_filter (‘woocommerce_payment_complete_order_status’, ‘my_change_status_function’);
<?php
function my_change_status_function ($order_id) {
$order = new WC_Order($order_id);
//Do whatever additional logic you like before….
return ‘completed’;
}
?>