Re: shopping cart remembers cart with COOKIES instead of SESSION?
| From: | Derek Sivers | Date: | Sat, 02 Dec 2000 20:53:58 +0000 |
| Subject: | Re: shopping cart remembers cart with COOKIES instead of SESSION? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28390@lists.php.net to get a copy of this message | ||
ooops - one last question for the list, before I go hacking at my cart:
please chip in your opinion, if you've done shopping carts before...
BEST METHOD FOR REMEMBERING ITEMS IN A CART FOR MONTHS?
(without asking people to "log in")??
METHOD A: JUST REMEMBER THE CART?
As strangers add things to their cart, create lineitems in our MySQL table, with their Session ID as the unique identifier (the temporary serial # to the cart).
METHOD B: CREATE AN EMPTY "CUSTOMER" ENTRY?
As a stranger comes to the site, create an empty entry in our customer table, using their Session ID as the unique "Return ID" that will look up their userid, even though there's no user info there yet. As they add items to their cart, add them to the MySQL table where the cart items will end up in a final sale anyway?
METHOD C: STORE IN SEPARATE "tempcart" MySQL TABLE?
Keep the "tempcart" table going with nothing but SessionIDs, and items that have been added. Do a "select items from tempcart where sid=$SessionID. $cart[]=$items";
METHOD D: ________???__________
If someone can point me to an existing cart that's doing it well, I'd love to just peek at someone else's PHP methods. I'm an intermediate newbie doing this from scratch, and need all the help I can get.
Thanks!!!!!