Skip to content
Advertisement

WooCommerce order status change from payment gateway

I have integrated a payment gateway to accept online payments for my store running on woocommerce. Everything works fine but I noticed that woocommerce is changing the order status to wc-processing for all the online paid orders by default.

As per my store’s functionality I want all the online paid orders to be in wc-on-hold status initially.

Is there any way to stop woocommerce changing the order status to wc-processing programatically?

Advertisement

Answer

yes there is a way, but you need to modify the payment plugin or add your own code, you can read this to understand how payments work.

Now, woocommerce use $order->payment_complete() method to handle the completed order, so you need to hook your own function to modify the status, here is the description of that method

Use this filter: woocommerce_payment_complete_order_status

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement