[thelist] Backend of a shopping cart system...

Casey Crookston casey.crookston at imibevcore.com
Fri Apr 5 09:22:01 CST 2002


I should add that the users customer id, in the carts I have done, have
all been stored on cookies.  This way, if the user closes his browser
and then comes back, I still have his ID.

If you use cookies, however, you will want to build a little cookie
sniffer and stick it on the top of every page (as you never know where
an entry point may be) that tries to set a cookie and then reteive the
value.  If it fails, redirect to a page which polietly says "This site
depends on the use of cookies, and it looks like you have them turned
off.  Here's our Privacy Policy."

HTH,

Casey

-----Original Message-----
From: Casey Crookston



Each time a user click's "Add to Cart" a record is added to your Cart
table.  This table will have several key fields, one being unique to
that row, one which relates back to the customer (a Customer ID) and one
which relates back to the product (a Product ID).  Another colum would
indicate the staus of this items in the cart.  Example 1=added but not
purchased; 2=Added then deleted; 3=Added and purchased.  When that
visitor comes back, your SQL statement which populates his cart will
select all items from Cart where Customer ID = current and Status ID =
1.

Other data in this table will record the date and time it was added or
deleted or purchased, etc.

HTH,

Casey


-----Original Message-----
From: Chris Blessing [mailto:webguy at mail.rit.edu]



But then how would I maintain their cart after the session expired?

Chris Blessing
webguy at mail.rit.edu
http://www.330i.net

> You have a session table and write the contents of their sesion to
> that. When they log out that deletes the row in the table associated
> with their sessionID
>
> Julian



More information about the thelist mailing list