Re: Suggestions on storing shopping cart info

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Would using a generic list (of these objects) be the best way to handle this
in your opinion? Store that to a session var?

"Mark Rae [MVP]" <mark@xxxxxxxxxxxxxxxxx> wrote in message
news:%23AbW$pDAJHA.1180@xxxxxxxxxxxxxxxxxxxxxxx
"Cirene" <cirene@xxxxxxxxxxx> wrote in message
news:%23lYTVGCAJHA.4992@xxxxxxxxxxxxxxxxxxxxxxx

As the shopper adds things to the cart and navigates throught the site to
shop more, should I store this info in a session var?

That would work. Alternatively, if you want the customer to be able to
save the cart and come back to it later, you should save it to a
database...

Should I create another class for cart and store an array of product_info
to keep track of what's in the cart, etc...?

That's what I do, though I tend to use a generic e.g. Dictionary<int, int>
to store the ID of the purchased product along with the number of items
purchased...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net


.



Relevant Pages

  • Re: Todays Priceless Supermarket Moment
    ... but deliberately flaunting the policy of the store. ... the "Express Lane 12 Items or Less" sign. ... wheeled her cart on down the road. ... When I shop at some of the more upscale markets a bit further away, ...
    (rec.food.cooking)
  • Re: PassingObjectstoWebForms
    ... You can store the object into a Session var and pick it up in following ... Context.Itemsto store request specific info to pass to transferred pages. ... > I have an object that gets created when the first ASP.NET webform, ... > the web app, is opened. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Session ? Static ?
    ... I have a function that returns data from my db as an array. ... times the script ... I was thinking doing an isset on the session var, if exists, use it, if not, ... hit the db and store the ...
    (comp.lang.php)
  • Re: Suggestions on storing shopping cart info
    ... But to perisist it using a session var doesn't using a List allow you to ... add and remove items in the cart? ... int> to store the ID of the purchased product along with the number of ... Store that to a session variable? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Suggestions on storing shopping cart info
    ... should I store this info in a session var? ... if you want the customer to be able to ... to keep track of what's in the cart, ... to store the ID of the purchased product along with the number of items ...
    (microsoft.public.dotnet.framework.aspnet)