I want to dissable this option:
Whenever someone makes and order on my site and the payment is successfull the order status automaticaly changes from pending to processing.
However I don`t want this feature to have enabled. Rather I want to do it manually when i proces the orders.
I found this function in the woocommerce which is making this feature possible. I don`t want to directly change it there but rather with some kind of php snippet which overrides this function.
Here is the function which i need to change : http://woocommerce.wp-a2z.org/oik_api/wc_orderpayment_complete/
PS: I just having a hard time to do it correctly.
Update
May be this
payment_complete()
is not involved in the process you are looking for. Alternatively, what you could try is thewoocommerce_thankyou
action hook instead:You can use the same alternative hook:
woocommerce_thankyou_{$order->get_payment_method()}
(replacing$order->get_payment_method()
by the payment method ID slug)Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested on Woocommerce 3+ and works.
Using a custom function hooked in
woocommerce_valid_order_statuses_for_payment_complete
filter hook, where you will return the desired orders statuses that can be taken by the related functionpayment_complete()
which is responsible of auto change the order status.By default the array of order statuses in the filter is:
And we can remove 'on-hold' order status this way:
Code goes in function.php file of your active child theme (or theme) or also in any plugin file.
This code is tested on Woocommerce 3+ and works.
Add the following code to your
functions.php
file.functionTested on WooCommerce with Storefront paid via Stripe test mode.