Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best solution for shopping cart 2

Status
Not open for further replies.

matthewking

Programmer
Jul 15, 2002
75
ES
Hi,

I was just wondering what would be the best solution to create a shopping cart, e.g. in terms of storing the cart, cart items etc.

I was thinking of creating a cart class, an instance of this can be stored in a session, which reads its items from the database using a unique id from the cart, but where does this unique id come from without using a database table for the cart too? this is just me thinking, feel free to suggest completely different ways of doing this

Any ideas/tips/methods/architectures for this would be greatly appreciated..

One requirement for the cart is that each cart item will carry a unknown size xml string, well..less then 5000 characters.

Thanks in advance,

Matt.
 
thanks,

One thing though, i've heard storing the cart info in objects/datasets/datatables etc isnt the best way of going about it as if you get 1000 users all with 10 items in their cart, thats alot of objects, info that that server has to keep up with..

anyone have any views on that?
 
You want to store their cart in a database for a couple of reasons:

1) You could be on a web-farm, and even though MS has really improved the session object to work with web-farms, once you reach a certain volume of traffic it'll start to get overloaded.

2) It allows the customer to come back the next day and their cart is still there. At some point, you will need to clear out "stale" carts, but that's just a policy decision.

Chip H.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top