Cool, sounds like I've been doing things right then.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.
What is the ideal shopping cart schema?
Moderator: General Moderators
- allspiritseve
- DevNet Resident
- Posts: 1174
- Joined: Thu Mar 06, 2008 8:23 am
- Location: Ann Arbor, MI (USA)
Re: What is the ideal shopping cart schema?
Re: What is the ideal shopping cart schema?
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 changesallspiritseve 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?
The "deleted" flag works OK, but it breaks the DB unique constraints.
There are 10 types of people in this world, those who understand binary and those who don't