[thelist] Shopping Carts -- where to store price

Warden, Matt mwarden at odyssey-design.com
Sat Sep 9 21:55:27 CDT 2000

> > In recent projects where I'm building a shopping cart system from
> > I've always decided to store the product foreign key as well as the
> > price in the cart table. Even though price is also in the product table.
> This is what I do also. Saves on a database call. Unlike Amazon, I don't
like to see
> prices change on customers. ;-)

What about when you can "save" a basket or when a basket persists beyond the
browser session. Is the possibility for this situation unavoidable? I mean,
in five years, you don't want Bob to be able to buy 600,000 widgets at the
price they cost today, do you? Is there another technique? Should you simply
timestamp the basket item and put logic in to "refresh" the price after it
has been in the basket for x hours/days/years/.../millenia?


More information about the thelist mailing list