dejangex Posted November 2, 2008 Share Posted November 2, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/131109-solved-stock-item-sale-or-one-time-sale/ Share on other sites More sharing options...
DeanWhitehouse Posted November 2, 2008 Share Posted November 2, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/131109-solved-stock-item-sale-or-one-time-sale/#findComment-680800 Share on other sites More sharing options...
dejangex Posted November 2, 2008 Author Share Posted November 2, 2008 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... Quote Link to comment https://forums.phpfreaks.com/topic/131109-solved-stock-item-sale-or-one-time-sale/#findComment-680811 Share on other sites More sharing options...
DeanWhitehouse Posted November 2, 2008 Share Posted November 2, 2008 My advice to you is not to make problems out of nothing, i will not suggest anything else as you will most likely find a problem in that. Try making the code work then work on any problems you have. Quote Link to comment https://forums.phpfreaks.com/topic/131109-solved-stock-item-sale-or-one-time-sale/#findComment-680812 Share on other sites More sharing options...
dejangex Posted November 3, 2008 Author Share Posted November 3, 2008 Perhaps you are right, maybe Im creating problems where there arent any. Tnx for the reply. When I get a solid problem, Ill be back. Quote Link to comment https://forums.phpfreaks.com/topic/131109-solved-stock-item-sale-or-one-time-sale/#findComment-680988 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.