Negative Balance / Stock
-
Hello,
We’re facing an issue where product inventory occasionally shows as negative. Let me explain the situation:
We have a variable product with multiple variations. One of these variations has a stock of 3 units. The stock management option in WooCommerce, under the Products and Inventory section, is enabled.
User 1 places an order and is redirected to the payment gateway, where they have 10 minutes to complete the payment. As you know, the inventory is only reduced if the payment is successful and the order status changes to
wc-inprogressing
. When an order is placed and the status ispending payment
, WooCommerce temporarily holds the stock in the reserved table.Meanwhile, Users 2 and 3 place their orders and complete their payments within less than a minute, reducing the stock from 3 to 2, and then from 2 to 1. At the same time, User 1 is still on the payment page, and one unit of stock is frozen in the reserved table. In this scenario, if another user, say User 4, tries to place an order for the same product, they should receive an out-of-stock message on the shopping cart page and should not be allowed to complete the order. This is because the stock has reached 1 with the first two orders, and one unit is still reserved for User 1.
However, the issue arises when, in many cases, WooCommerce allows User 4 to proceed with the order, reducing the stock from 1 to 0. Then, if User 1, who took longer to complete their payment, finishes the transaction, they receive a success message from the store, but the stock drops from 0 to -1 without any error notification.
I’ve researched this problem extensively, and it has been troubling users since 2018, continuing through 2024. This is why plugins like PURI Reserved Stock Pro have been developed.
https://puri.io/docs/reserved-stock-pro
Unfortunately, for various reasons, we are not allowed to use this plugin or create new stock statuses. I would greatly appreciate any advice you can provide.
- The topic ‘Negative Balance / Stock’ is closed to new replies.