Page 2 of 2
Re: What is the ideal shopping cart schema?
Posted: Tue Jun 30, 2009 9:45 pm
by allspiritseve
arborint wrote:I use separate cart and order tables just like you do. I don't delete products, just mark them as unavailable. You do have to save the price and any other volatile information in the order item record because they will change in the product records.
Cool, sounds like I've been doing things right then.
Re: What is the ideal shopping cart schema?
Posted: Wed Jul 01, 2009 1:37 am
by VladSun
allspiritseve wrote:How do you guys handle order data after the order has been completed? For example, a user may have ordered a certain product that was deleted after the order was placed. It seems like most or all of the product data should be saved somehow, I don't know if it's better to keep that in a separate table, or just put a flag on old products to mark them as deleted?
In real world system you should not delete any information related to orders. That's because the user requirements will always include a reports system. There are other nasty things there - e.g. should you consider a changing the price of a product a new product or you should have a table for tracking price changes
The "deleted" flag works OK, but it breaks the DB unique constraints.