Hello,
I need to build a shopping cart in ASP, but it's the first time I'm doing this. I'm quite experienced in ASP sites but there's only one thing that prevents me from doing this shopping cart easily:
I would like to ask how is it possible to save info such as the items that the customer adds to his cart, each item's quantity, price and productID, and other cart info such as payment method etc.
I was thinking that maybe this is possible to do with cookies in an array form, and then use FOR... EACH statements when displaying the info. For example:
The customer adds to his cart a product named "Vanilla", product ID 34, priced $13 and quantity of 2:
intProdID = Request("prod_id") // 34 Response.Cookie("items")( intProdID )("name") = Request("name") // Vanilla Response.Cookie("items")( intProdID )("price") = Request("price") // 13 Response.Cookie("items")( intProdID )("qty") = Request("qty") // 2
|
And then when I want to display the info:
FOR EACH item IN Request.Cookie("items")
Response.Write(item & " " & item("name") & " $" & item("price") & " x " & item("qty") & "<br>"
NEXT |
Will display:
Will something like this work? And how to write it correctly?
Thanks.
Edited by FLATLINE