lafflam, As you can see

Posts: 171
Joined: 08/08/2007
Early adopter... addicted to alphas.Getting busy with the Ubercode.

lafflam,
As you can see there are probably dozens of ways to do the stock tracking and they are based on the type of product (one off ABBA shirts or a more advances third party fulfillment system that can check with the manufacturer and see if the car part is still being manufactured or not and then order more as needed, etc). We did have a long debate on these forums, before the server went down, and I came to the conclusion that it was impossible to cover all the bases so instead I would make an API and a simple stock level tracing system that worked pretty much as 'cobrasound' outlined it above (and I thought it did work this way up until I got back from holidays this week, I'll try and fix the bug). That is stock is decremented when purchase is confirmed.

An immediate argument against the decrement when adding to cart is that say you have a site with 5000+ visits a day and 10% put the most popular t-shirt in their cart (of which you have only 300 in stock) and then only 10 of the 500 actually want to by that t-shirt. On a bad day they have a less than a 1/50 chance of actually getting a hold of that shirt. The more poplar the site the less likely some one can make a purchase, which isn't what you want.

Really, the merchants don't care about the 'fairness' of who gets the 'right to buy', they only care about selling in my experience. Last minute bidding on eBay has never disgruntled the people who get out bid at the last minute as everyone knows the rules and there is a level playing field and thats the best you can hope for. I'm sure if speedier checkouts is the result the merchant isn't going to be complaining.

Anyway, the option is there for you to write your own inventory manager that does it the way you like it while sharing the reusable part of the code, the API, which will get stronger the more people plug their managers into it.

Paypal, and all payment methods, should return a 'yes' or 'no' from the payment process, correct? I guess, decrement, when someone goes into Paypal, and then if it returns 'no' increment the stock again, if the orders state stays in 'pending' (i.e. when the customer is in the process of paying) indefinitely then the order system should ether time it out or it should be done manually by the order admin. This should happen for _all payment processes_, no?

So, I guess I will try and decrement the stock when the purchase phase is started, i.e. immediately after the 'review' screen, and increment if payment was declined. Is this possible Ryan?

--

suffering from too much information

Inventory API not decreasing uc_stocklevels By: lafflam@drupal.org (56 replies) Wed, 08/22/2007 - 21:46