cart cookies

S

shank

I need to build my own simple cart that writes to cookies only. I can write
and read cookies, but don't have a clue as to how I can add multiple
products, change quantites, etc. All I need is a cart that stores
information in cookies and the user prints their order. That's it. Where can
I find such information?

thanks
 
A

Aaron [SQL Server MVP]

A cookie is just a text file. There are no columns, and there is no such
concept as "change the quantity"... if you change the data, you re-write the
cookie...
 
S

shank

How about a tutorial on writing rows of data to cookies?
I understand writing one set of values, but a cart cookie would hold many
sets of values.
thanks
 
A

Aaron [SQL Server MVP]

I understand writing one set of values, but a cart cookie would hold many
sets of values.

What, you mean like

Response.Cookies("row1") =
"Q=5,pID=sku67282,description=bra,price=15.99,size=36D"
Response.Cookies("row2") =
"Q=1,pID=sku67283,description=boxers,price=12.99,size=XL"
Response.Cookies("row3") =
"Q=2,pID=sku67284,description=teddy,price=44.99,size=4"

?

I don't know what kind of tutorial you're looking for. I also don't know
why you would want a cookie-only shopping cart. What advantage does this
give you over existing methods, for which source code is readily available?
 
S

shank

I'm trying to get a fully functional website onto a CD. Along with that I
would like to add a simple cart where a user can add products and print out
their order. Hence, the need for cookies. I cannot send them to the internet
or write to a database. Doing that would be to friggin' easy...
thanks
 
A

Aaron [SQL Server MVP]

How do you plan on running ASP code from a CD? Do you expect end users to
be able to install / configure IIS, and make a virtual directory pointing to
their CD-Rom?
 
S

shank

ActiveSite Compiler will do it. I've tried it and it works. The downside is
that it must use ASP and one other language like vbscript.
 
J

Jeff Cochran

ActiveSite Compiler will do it. I've tried it and it works. The downside is
that it must use ASP and one other language like vbscript.

ASP isn't a language. VBScript (or Jscript) is the language used in
ASP.

Which brings up your assertion that you can't use a database. Which
you can, you just can't write to it. Which means you can have saved
queries though, and just store the query variables in the cookie, item
number and quantity for example. The description, price, etc. are all
retrievable.

Or write to a local file, running off CD you can still write to the C:
drive. Or stop trying to do this in ASP and do a VB front end, like
normal programmers. :)

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top