PDA

View Full Version : Shopping baskets with sessions


holty
10-14-2005, 11:04 AM
Hi

I'm looking for a decent article with an example of a shopping basket using sessions - I can't seem to find one when i google.

I would have used a database but thats out of the question for this project :(

Hope someone can help :)

NancyJ
10-14-2005, 11:30 AM
If databases are out of the question where is all the data going to be stored after the session?
While it is possible to use sessions for shopping carts they're less flexible, harder to make changes to and overall less 'stable' than db based solutions.

I have made a site that uses sessions for the shopping cart (http://www.italianworld.org.uk) having done a database driven cart since I found it much easier to work with.

Basically what I did with my sessions based cart was create a global array in the gobal.asa and stored it in a session. Then to add a product I searched the array to see if the product and options combination was already existing in the array, if it was I incremented the value by the quantity, otherwise added a new entry and stored the array back in a session value.

Bullschmidt
10-17-2005, 05:41 AM
And while admittedly a little short on detail perhaps this may hopefully give you some ideas along the same line (although whether or not to use global.asa is up to you):

Classic ASP Design Tips - Shopping Cart
http://www.bullschmidt.com/devtip-shoppingcart.asp

curlywhite
10-21-2009, 07:43 PM
I found one good shopping baskets with a swing handle at www.luckyclovertrading.com. Maybe you can check it out they have a lot of selections.

bazz
10-21-2009, 07:57 PM
spam, but quite funny.