Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

[Resolved] Inventory goes to -1 / “Sold out” item can be purchased

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Inventory goes to -1 / “Sold out” item can be purchased

Tagged: inventory, transaction

  • This topic has 5 replies, 2 voices, and was last updated 4 years, 1 month ago by PJV20977.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • March 28, 2021 at 10:09 am #82787
    PJV20977
    Spectator

    Hi

    I hope someone can help, as while this does not happen very often, it is bad for business reputation when it does!

    Sometimes the inventory count for an item goes to minus 1 (-1).

    I investigated it, and what I believe is happening is when I send out a newsletter for a new product, numerous customers click to the product page, then they add the item to the cart — but don’t buy right away. Maybe they leave it and come back the next day … in which time, someone else has bought the last one and taken the inventory to zero.

    But the WP eStore still allows the transaction to go through, even with inventory zero. It doesn’t seem to “double” check the inventory.

    Is there a fix or any code I can add that will double-check the inventory before checking out — i.e. after clicking the pay button?

    All help and advice much appreciated.

    Cheers!

    March 28, 2021 at 10:11 am #82789
    PJV20977
    Spectator

    Sorry — can someone please move this to “WP eStore Troubleshooting” if better placed there?

    March 28, 2021 at 3:34 pm #82793
    wzp
    Moderator

    But the WP eStore still allows the transaction to go through, even with inventory zero. It doesn’t seem to “double” check the inventory.

    1. The inventory check is done at the time a user clicks the “Add to Cart” button.
       
    2. When PayPal sends the IPN back to eStore, after a successful payment, is when the inventory is decreased.
       

    The cart contents are stored using PHP sessions. Sessions usually expire after 20 or 30 minutes (You can control this by specifying how long your PHP session data stays valid in your server config). Otherwise; once a user adds an item to a cart, the item will “hang around” in the cart for up to 30 minutes. This would explain the “sometimes” issues. One way to avoid this, is to pre-emptively sell popular items as “Buy Now.” This will force an immediate purchase decision on the part of the user.

    April 1, 2021 at 11:06 am #82829
    PJV20977
    Spectator

    Thanks for the reply!

    Will the likes of W3 Total Cache exacerbate the issue, do you know?

    April 1, 2021 at 7:00 pm #82830
    wzp
    Moderator

    If you plan to use W3 Total Cache, you must properly configure it, according to these instructions.

    April 2, 2021 at 4:26 am #82833
    PJV20977
    Spectator

    Thanks.

    I’ll do that now.

    I had configured it based on other — earlier? — instructions on your site which were first to pop up in Google results. I did hunt around for other instructions, as they did seem curiously brief, but I’ll implement these now instead.

    • This reply was modified 4 years, 1 month ago by PJV20977.
  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ