I'm going to implement the original shopping cart. I've already done this already, but looking for a better way.
In fact, the way I first set up the table, it was like this:
MyCart table:
UserId ProductID Quantity TotalPrice 06 PID08 1 499.00 06 PID06 2 200.00 06 PID04 1 499.00 06 PID01 1 499.00 06 PID09 1 499.00 02 PID25 1 499.00 As you can see, there are only 2 customers in their cart Items are added 06's There are five items in the shopping cart and items in the shopping cart 02 . I'm thinking that it would be better to insert an array, instead of just adding and adding and adding, but what about a list? Can you add a list to the DB table? How do you add items to a "cart"?
This is almost exactly how I will implement it, except that I have GUIDs as keys Appears to be used.
However, you should not store the price in that table; It can be easily calculated by multiplying the price of the product on the basis of quantity.
If you allow custom-per-user pricing, then it may be meaningful to save the price here, though this information will still be better for furthering that value < / Html>
Comments
Post a Comment