Jump to content

Recommended Posts

This is a theoretical question, since my project does not exists yet and now I ran into a problem. Suppose there is an online shop that sells one item only once and then the item is removed from the shop. This shop uses a third party gateway for payments(paypal, moneybookers, etc.). The possibility that two people will try to buy it at the same time is low, but still exists so how to deal with this problem? Same thing applies if there is only one item left in the stock, and two people try to buy it at the same time. There is a chance that I will be paid for a product I cant provide.

Link to comment
https://forums.phpfreaks.com/topic/131109-solved-stock-item-sale-or-one-time-sale/
Share on other sites

Maybe when the person adds it to there basket or looks at it, set it in the database as sold (or similar), and if they buy it then it will be removed if not then it will be active after a few minutes?

 

So make a timestamp as well.

I did thought about that, but what would happen if the customer went to the payment page, waited there for 30 min. and then payed. Someone else could buy it in that time frame. Also hiding the item is not a very good solution because somone could abuse the system to constantly hide some item of interest by adding it to the basket/clicking checkout, and because some people browsing the items could miss those that reappeared. Hmmm...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.