Welcome Guest, Not a member yet? Register   Sign In
Shopping Cart
#6

There is none, make your own. A good cart is only responsible for two things - the product id and the quantity.
It also holds some other information, like the product name and the product price - but its not 'responsible' for that info especially the price.

Put this another way - someone puts a product in the cart. They come back a week later to check out. Meanwhile that products price has gone up,
or the product has gone out of stock and is not available at all. Either of those conditions will be very bad for your merchant. So the cart is not in charge of those things, which means it needs to ask the Product table - is this still in stock? is this still the price? etc.

The cart is also not in charge of shipping, tax, discounts, or any order totals. Use a separate shopping session table for that. And when the order is paid for the carts job is done. Make separate tables for the Order and Order Items. Then your cart never has historical data that must be kept, and your Orders and Order Items tables are private and everything in them is historical data.
Reply


Messages In This Thread
Shopping Cart - by davy_yg - 05-12-2016, 11:49 AM
RE: Shopping Cart - by albertleao - 05-12-2016, 12:21 PM
RE: Shopping Cart - by albertleao - 05-12-2016, 12:22 PM
RE: Shopping Cart - by cartalot - 05-12-2016, 01:59 PM
RE: Shopping Cart - by davy_yg - 05-12-2016, 05:53 PM
RE: Shopping Cart - by cartalot - 05-13-2016, 11:03 AM
RE: Shopping Cart - by albertleao - 05-13-2016, 12:01 PM
RE: Shopping Cart - by cartalot - 05-13-2016, 12:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB