[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
scratch,
> > I've always decided to store the product foreign key as well as the
product
> > price in the cart table. Even though price is also in the product table.
I
>
> 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?


--
mattwarden
mattwarden.com





More information about the thelist mailing list