1

I have 2 payment gateways in woocommerce, cash on delivery and credit card.

After the client sends the order with cash, i get the order status to processing. BUT, after they pay with credit card and payment is succesfull the order status goes to complete.

How can i make the order status to say processing after they paid with the card? And only after they received the goods, the shop manager can set the order status to complete.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Catalin
  • 81
  • 7

1 Answers1

1

Try to use the following, which will set paid orders status to processing by default:

add_action( 'woocommerce_payment_complete_order_status', 'wc_auto_complete_paid_order', 10, 3 );
function wc_auto_complete_paid_order( $status, $order_id, $order ) {
    return 'processing';
}

Code goes in functions.php file of the active child theme (or active theme).

Related: WooCommerce: Auto complete paid orders

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
  • And after i manually set the order to complete, will it stay that way? Or after refresh will it get back to processing? – Catalin Sep 21 '20 at 19:35