I would only decrease stock value when the shopping cart gets converted to a purchase.
Chances are rather slim that many people will buy the book at the same time, and if it does you should try to anticipate this and create a larger stock for popular books :) Also, every formula you invent to calculate stock values will never be accurate ... and I'm pretty sure you don't want to miss out on a sale just because your formula calculated a negative stock but in reality it was only 10 people having it in their shopping cart and not buying the product. Keep it simple :) On Thu, Sep 24, 2009 at 12:44 PM, cakeFreak <freakclimb...@gmail.com> wrote: > > Hey guys, > > my question is about developing an eCommerce solution in PHP, and it > about dealing with stock quantities. > > When you have real products (not services or e-books, for example, but > real books instead) how do you deal with the following situation: > > 1) you have 10 copies of Book "Learning CakePHP" in stock > 2) you have 20 customers in the eCommerce website at the same time > 3) 15 customers add a copy of the Book "Learning CakePHP" to their > shopping chart > 4) only 5 customers finally biught the book > > At this point my question is: how do you work with your stock values? > Decreasing the stock every time a customer adds to chart, is a bit > risky. > Maybe using a kinda average purchasing rate (say only 50% of those > that added to chart bought the book) it would be less risky to manage > stock values? > > Dunno if I'm overcomplicating the problem. Just Curious about your > opinion and solutions to this issue. > > Daniel > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---