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 3 years, 7 months ago by PJV20977.
-
AuthorPosts
-
March 28, 2021 at 10:09 am #82787PJV20977Spectator
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 #82789PJV20977SpectatorSorry — can someone please move this to “WP eStore Troubleshooting” if better placed there?
March 28, 2021 at 3:34 pm #82793wzpModeratorBut the WP eStore still allows the transaction to go through, even with inventory zero. It doesn’t seem to “double” check the inventory.
- The inventory check is done at the time a user clicks the “Add to Cart” button.
- 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 #82829PJV20977SpectatorThanks for the reply!
Will the likes of W3 Total Cache exacerbate the issue, do you know?
April 1, 2021 at 7:00 pm #82830wzpModeratorIf you plan to use W3 Total Cache, you must properly configure it, according to these instructions.
April 2, 2021 at 4:26 am #82833PJV20977SpectatorThanks.
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 3 years, 7 months ago by PJV20977.
- The inventory check is done at the time a user clicks the “Add to Cart” button.
-
AuthorPosts
- You must be logged in to reply to this topic.