Shawn wrote:
> Is there any way for an item to get moved to a temp database table when it
> is added to a cart?  I want this so that if 1 product is left and it is
> added to a cart, it cannot also be added to another cart at the same time.

Ahh, another subject that is near and dear to me.

The freetrade code decrements the inventory at the
time of SUBMIT_ORDER.  You are expected to leave a
little bit of slack in inventory.Reserve in case
two people order the item at the same time.  This
seems to be an okay approach for typical sites.

I have worked on projects which sell in bulk.  This
changes things a bit.  Bulk purchasers tend to buy
10, 50, or maybe 100 of one item.  If your inventory
level is in the 100's then a "Reserve" system just
isn't going to cut it.  On one of my projects, I
modified the inventory system so that it decrements
when the item is put in the basket rather than when
the item is purchased.  This means that expiring
old sessions requires returning items to inventory.
To me, this seemed like too much work to handle in
include/init which happens at the beginning of
random Joe's page display.  I moved the session
expiration and the stale invoice expiration to a
cron job which returns items to inventory.

As an extra issue, with bulk purchases, the odds are
that the buyer doesn't want quantity one, so it's
kind of silly to default to one and then make him
change it.  On this project I made the ADD_BASKET
take a quantity.  I eventually ended up making the
"contents" screen NOT offer to change the quantity.
Instead the buyer would click on the cart item and
it would return him to the "item" screen, where he
could change the quantity if he desired.  This screen
displays the inventory, and makes sure that changes
to the cart quantity properly affect the inventory.
--
Paul Chamberlain, [EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Site:            http://www.working-dogs.com/freetrade/
Problems?:       [EMAIL PROTECTED]

Reply via email to