Hello,
By default, the “Pending Payment” status does not reduce stock, but “On Hold” does. You can read more about order statuses here: https://docs.woocommerce.com/document/managing-orders/#order-statuses
If you’d like to force reduce stock with Pending Payment, you can add the following code:
add_action( 'woocommerce_order_status_pending', 'wc_maybe_reduce_stock_levels' );
The code should be added to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code Snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update.
Hi @albertsauque
We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.
I have same problem.
I tried that code with Snippets and it worked like some time ago but not anymore.
Stock is not reduced when order is in “waiting payment” state.
This really should be coded inside Woocommerce and let people to decide if stock is reduced or not.
Impossible to run webstore when people still see that product is available when it is not. Somehow Woocommerce still reserves the product for orders in “waiting payment” but doesn’t really reduce stock so that me or customer see it, because I hear my customer complaining that in the end it gave warning about missing stock. That is of course not good, people should see it already beforehand and not being able to put it in cart and notice it later in process.
-
This reply was modified 4 years, 10 months ago by
henesuo.
-
This reply was modified 4 years, 10 months ago by
henesuo.
-
This reply was modified 4 years, 10 months ago by
henesuo.