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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concept of shoppin cart thanks

Status
Not open for further replies.

melnet

Programmer
Jul 8, 2003
77
HK
hi

when user add some items into shopping cart, what method should i choose?

Session("OrderProduct") = Session("OrderProduct") & "[" & productid & "(" & qty & ")]"

means that
Session("OrderProduct") =
Session("OrderProduct") & [ProductName_A(9)][ProductName_B(20)][ProductName_C(1)]

but i am afraid some product name will be duplicated.
so i did
Session("OrderProduct")[ProductName_A_10000001(9)][ProductName_B_10000002(20)][ProductName_C10000003(1)]

*ProductName_A_10000001, 10000001 is product id.

if id is 10000001, coz the id is long. i think id and qty will have no error.

however if [ProductName_B_10000002(1)] changes to [02(1)], there have a error.

i hope guys understand what i write.

any good methods to me for refer!?

thanks a lot.

 
personally with shopping carts i like to use a shopping cart table in a DB, and in combo with cookies, the user's stuff will still be there for them should they return to the site ( with a SP that removed over a week/month old cart contents ) but the nice part with the DB/Table combo is you can just request if that item is in cart, if it is, +1 if not, add it.

and opposite is true for removing items, -1 or delete.

[thumbsup2]DreX
aKa - Robert
 
I agree with Robert. Do not use sessions, store the data in a database and then store the Order_ID (or whatever unique identifyer you will use) in a cookie. I have done this a few times and it works well.

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top