Forums

ASP

This topic is locked

Custom Shopping Cart App

Posted 07 Dec 2005 05:51:04
1
has voted
07 Dec 2005 05:51:04 Matt Millican posted:
Hi all,
I'm working on a shopping cart system from scratch. I've done one before, but would like to make a few changes.
In the past, I've saved the user's cart items into a session variable and then on the cart page, pulled them out as an array and split them up to use in a recordset. That worked fine for the most part. What are some other ways that I can add items to a user's cart?

Secondly, can someone help me out with some syntax for creating a "related items" type thing. In the products table, I have a field, which holds the IDs of other related items in the store. How could I easily pull this out so that it will be able to pull a recordset of info?

Hope this make sense, and any help you can give would be greatly appreciated. Thanks
Matt

Matt Millican
InternetMill.com
www.internetmill.com
(XP Pro / Dreamweaver MX / Access XP Pro/ MS SQL / ASP / VB Script / PHP, mySQL / Photoshop / Fireworks)

Replies

Replied 13 Dec 2005 00:40:30
13 Dec 2005 00:40:30 Lee Diggins replied:
Hi Matt

I would store these items in table with the user id and item id otherwise when the session ends so does the items in the cart. This would also help you build a set of related items using a join, just an example:

SELECT tbl_product.related_product_id, tbl_product.related_product_description
FROM tbl_product
INNER JOIN tbl_cart_session ON
tbl_product.related_product_id = tbl_cart_session.related_product_id
WHERE tbl_cart_session.session_id = myVariable

That type of thing mebbe

Sharing Knowledge Saves Valuable Time!!!
~ ~ ~ ~ ~ ~
<b>Lee Diggins</b> - <i>DMXzone Manager</i>
&lt;font size="1"&gt;[ Studio MX/MX2004 | ASP -&gt; VBScript/PerlScript/JavaScript | SQL | CSS ]&lt;/font&gt;

Edited by - Digga the Wolf on 13 Dec 2005 01:03:54

Reply to this topic