• Resolved komsboymore

    (@komsboymore)


    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 is pending 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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello komsboymore,

    Thank you for contacting Woo support.

    The stock should never go into negative numbers under normal circumstances.
    In the scenario you described, User 4 should indeed be unable to complete the order if the stock is depleted and reserved quantities should prevent further purchases.

    This functionality is built into WooCommerce, so there’s no need for additional plugins to handle it.

    To better understand the problem, could you provide the following information:
    – How did you determine that the stock is going negative?
    Any specific error logs or scenarios that highlight this issue would be helpful.

    – Are you using Block-Based Checkout or Legacy Shortcode Checkout on your site?
    This will help me identify if the issue might be related to the checkout method in use.

    With these details, we can further investigate and work towards a resolution.
    Looking forward to your response. ??

    Best regards

    Thread Starter komsboymore

    (@komsboymore)

    Hello Zubair.

    For your questions:

    – How did you determine that the stock is going negative?

    When we want to charge again the stock we saw that the stock is -1 or -2 or -3

    – Are you using Block-Based Checkout or Legacy Shortcode Checkout on your site?

    We’re using Legacy Shortcode that is added to a page
    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @komsboymore

    Thank you for getting back to us with the information requested.

    The issue you’re experiencing with your stock going into negative numbers is unusual and not typical of WooCommerce. The stock status should indeed be accurately maintained, and users should not be able to purchase more than the available stock.

    Did you test using the block based checkout system? Didn’t it make any difference?

    To troubleshoot this, I suggest you temporarily switch to a default WordPress theme (like Twenty Twenty-Four or Storefron) and disable all plugins except WooCommerce. Then, try to replicate the issue. If the problem does not occur, it means there is a conflict with your theme or one of your plugins.

    Please let us know the results of these steps so we can help you further.

    Thread Starter komsboymore

    (@komsboymore)

    Thank you for reply.

    Our website is Live and under heavy traffic… and we have no staging area for testing (Because of licensing of some plugins). So we can’t disable plugins and theme to test.

    I know that this is unusual and maybe it’s a conflict. But I want to ask a question.

    Is it possible that this problem related to HPOS and it’s compatibility mode ?

    Regards.

    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @komsboymore

    I understand the challenges you’re facing with testing on a live site. However, without performing those tests, it’s quite difficult to pinpoint the exact cause of the issue.

    Is it possible that this problem related to HPOS and it’s compatibility mode ?

    It shouldn’t. However, without further testing, it’s hard to confirm. HPOS or any other third-party plugins could potentially cause conflicts or unexpected behavior.

    If you can’t set up a staging site, you could consider setting up a local testing environment using a tool like Local by Flywheel or MAMP. This way, you can replicate your live site and perform all the necessary tests without affecting it.

    Once we can isolate the issue, we’ll be in a better position to provide a solution.

    Looking forward to hearing from you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Negative Balance / Stock’ is closed to new replies.