Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Troubleshooting › Available Copies and multiple pending client sales race condition
Tagged: available quantity
- This topic has 3 replies, 2 voices, and was last updated 7 years, 10 months ago by wzp.
-
AuthorPosts
-
January 1, 2017 at 10:33 pm #13906Christopher T. GriffinMember
I have created a new tangible product for which I have 5 physical copies of in inventory. The product management interface is configured to show that the available quantity is indeed 5 for that product. In the Manage Products interface it shows Available Copies 5, Sales Count 0 as the initial condition.
I bring in a test client1 to place multiple sequential “Add to Cart” past the limit of 5 and confirm that the shopping cart limits the order quantity of that item to 5. I let test client1 sit there pondering whether or not to place the order, but still goes back to the product display information via the Fancy1 or Fancy2 templates and the “Available Qty: 5” is shown. Hmmm… Is that right? In the Manage Products interface it shows Available Copies 5, Sales Count 0 as the current condition.
So, I bring in a test client2 in a separate session on a different device to place multiple sequential “Add to Cart” actions on the very same product that client1 played with and client2 also sees the “Available Qty: 5” even after multiple “Add to Cart” actions past the limit of 5. The cart integrity looks fine for client2 as no more than 5 items could be ordered, yet they still see “Available Qty: 5” in the product display page. Hmmm… Is That right? In the Manage Products interface it shows Available Copies 5, Sales Count 0 as the current condition.
Then, my brain crashes at the thought of a race condition to PayPal order entry as both Client1 and Client2 think they each are going to get a deal of their lifetime by getting 5 of these identical items each for a total of 10 for which I do not have inventory for.
January 1, 2017 at 11:00 pm #74866wzpModeratorThe inventory count will only go down during IPN processing. Whether or not we are talking physical products, digital products or real world products; these kind of things are always plausible.
https://support.tipsandtricks-hq.com/forums/topic/one-serial-two-buyers-at-the-same-time
In all of the 10+ years eStore has been on the market, the kind of scenario you envision has NEVER made it past the “thought experiment” stage.
BTW, because you are dealing with physical products, be like Amazon… Offer a refund, discount coupon, or other form of customer satisfaction good-will.
January 2, 2017 at 12:26 am #74867Christopher T. GriffinMemberThank you for you quick response, I really appreciate that.
I will test further to get past the “Thought” experiment point of failure, but it would appear that this is an architectural design decision made by the creators of WP eStore for which real life run-time has proven not to be an issue. I will test further and let you folks know. Given the low number of anticipated concurrent orders for my system, it will most likely be a “LOTTERY” scenario for it to be an actual problem.
I see the trade-off in the WP eStore implementation to not prevent an order from completing just because someone else is sleeping on their keyboard or left their shopping cart in an open state but forgot. Makes sense. A fair design decision. As long is everyone is aware of the timing black hole that it presents.
Just saying…
–Christopher
January 2, 2017 at 1:34 am #74868wzpModeratorIn the US, we have a Christmas shopping ritual called “Black Friday.” In the week leading up to Black Friday, a store may advertise TVs for half price. But only have 200 in stock. Then, on the evening news will be a story about the 600 people fighting for the 200 TVs.
“Life is not fair.”
Scar — The Lion King
-
AuthorPosts
- You must be logged in to reply to this topic.