[ic] Prevent from ordering more than is in stock

Jim Balcom interchange-users@icdevgroup.org
Tue Oct 15 18:11:01 2002


On Tue, 15 Oct 2002, Mike Heins wrote:

MH>>As part of my continuing series plugging IC 4.9, there is now a feature
MH>>that does this:
MH>>
MH>>    MaxQuantityField  inventory:quantity
MH>>
MH>>You can set a field which will intrinsically limit the order quantity to
MH>>the amount in inventory. If the user orders 9 while 9 are in stock, then
MH>>there is an intervening order for 5, the number on order will automatically
MH>>be adjusted to 4 on the next cart refresh.
MH>>
MH>>(The observant will notice that there are of some possible problems with
MH>>contention there, as it would be possible to have an order adjusted
MH>>between time of loading the checkout page and time of actual order
MH>>placement. There is some exception handling possible with this, but it
MH>>isn't documented yet. This type of thing is a very advanced function though,
MH>>and probably anyone using it should be capable of perusing the source.)
MH>>

When is it counting the inventory, and when is it being deducted?

Customer A orders 10 gadgets and puts them in his cart. (There are only 15
in stock). Does it deduct them then, or does it deduct them when he
submits his order? Or, after the CC# approval and the receipt sent to him?

Customer B orders 10 gadgets and puts them in his cart at the same time as
Customer A. They both hit 'submit' within seconds of each other. The first
one submitted has a declined card, so at that precise moment there are 15 in
stock for customer B. Does customer B only get 5?

Depending on when they are deducted, if they get deducted when they are put
in the cart, will they get plussed when they are removed from the cart? And,
if customer B has been told that he can only have 5, does he get his desired
quantity restored when customer A takes them out of his cart?



-= Jim =-

                   .-.
                   /v\
                  // \\
                 /(   )\
                 ^^ - ^^
          > Phear the Penguin <
              L  I  N  U  X

----------------------------------------------------------------
Jim's Linux-Operated Underground Bomb Shelter

Tagline for Tuesday, October 15, 2002 at 17:55 PM:
"Stupid" is a boundless concept.

----------------------------------------------------------------
This Linux System has been up 47 hours

My web page: http://www.idk-enterprises.com
----------------------------------------------------------------