Shopping cart db design - accounting for product variations

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Shopping cart db design - accounting for product variations

    Hi

    im designing a database/asp cart that sells tshirts online. at the
    moment, each tshirt has a product id which is stored in a table called
    session_product along with the session_ID.

    The thing I want to know is how to store the colour variation of each
    tshirt when a user adds the tshirt to their basket. I dont really
    want to have to create a new product id for each colour...

    any help appreciated!
    raj Guest

  2. Similar Questions and Discussions

    1. Shopping Cart Help!
      Hi there. I'm a total newbie developing a small biz commerce website and have no idea how to configure a cheap, quick and easy shopping cart - does...
    2. Product Zoom Shopping Cart Extension/Plugin
      Does someone have an idea or direct me in the direction of making an e-commerce page with product zoom like on amazon.com. Plugin/extension, sample...
    3. Shopping cart help
      Hi, I need to create a shopping cart style website. Are there any good tutorials or 'shareware' stuff out there that I can look at? I want to do...
    4. shopping cart shopping
      Im looking to buy some ecommerce software to hook up to an HTML site. The company will have around 350 products or so to start out, and will be...
    5. JS shopping cart
      peterct07@yahoo.com (Peter Cartwright) wrote in message news:<b6141bd7.0307171525.1c322082@posting.google.com>... Oops wrong forum
  3. #2

    Default Re: Shopping cart db design - accounting for product variations

    > im designing a database/asp cart that sells tshirts online. at the
    > moment, each tshirt has a product id which is stored in a table called
    > session_product along with the session_ID.
    >
    > The thing I want to know is how to store the colour variation of each
    > tshirt when a user adds the tshirt to their basket. I dont really
    > want to have to create a new product id for each colour...
    Well, you could have a color column, though not all products will have
    color. You're also going to have to have a size column, a quantity column,
    ....

    A product database is not a light endeavor... there are many variables you
    must take into account, and there will be growing pains I can assure you...


    Aaron Bertrand [MVP] Guest

  4. #3

    Default Re: Shopping cart db design - accounting for product variations

    I have just finished one for a major company and part of there products are
    clothes.
    I gave the each product a product number and with products with different
    colours / sizes i added an extra coloum with colours in it.

    Then for displaying to customers I grouped by product number and provided a
    button to display all colours, for this I added an extra form on top that
    queried the db for that product number and dynamically built new page with
    available colours, .
    Then I wrote back to table or array those selected items refering back to
    the record number.
    This allows for multiple variations in the same product..

    Of course items in db are one colour per row.

    Regards
    Don



    "raj" <karwalr@hotmail.com> wrote in message
    news:477bcb83.0312021609.3dfea814@posting.google.c om...
    > Hi
    >
    > im designing a database/asp cart that sells tshirts online. at the
    > moment, each tshirt has a product id which is stored in a table called
    > session_product along with the session_ID.
    >
    > The thing I want to know is how to store the colour variation of each
    > tshirt when a user adds the tshirt to their basket. I dont really
    > want to have to create a new product id for each colour...
    >
    > any help appreciated!

    Don Grover Guest

  5. #4

    Default Re: Shopping cart db design - accounting for product variations

    Hmm..i see what you mean. The problem that will arise is that when you
    add the product to the shopping cart (session_product table), how do you
    know what colour product is added? The product id alone wont give you
    this.

    The only way I can think of is to have another table called
    product_colors which holds a unique Id, productID and colour. The
    product table can then have a color column which reference the unique ID
    from the product_color table. This ID would also be added to the
    session_product table to get the product colour variation..

    what u think?



    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    raj k Guest

  6. #5

    Default Re: Shopping cart db design - accounting for product variations

    On 2 Dec 2003 16:09:10 -0800, [email]karwalr@hotmail.com[/email] (raj) wrote:
    >im designing a database/asp cart that sells tshirts online. at the
    >moment, each tshirt has a product id which is stored in a table called
    >session_product along with the session_ID.
    >
    >The thing I want to know is how to store the colour variation of each
    >tshirt when a user adds the tshirt to their basket. I dont really
    >want to have to create a new product id for each colour...
    Well, if you do a separate ID for each variation of a product, then
    those variations just become attributes of that entity. That makes
    table design easier, some coding easier and dramatically increases the
    number of SKU's you deal with, and display. If color becomes an
    entity, then you have to work out the relationship with your items,
    since presumably many t-shirts could be the same color and one t-shirt
    could be many colors, a typical many-to-many relationship. That means
    you end up with more tables, but better control and representation of
    the product.

    Normally you'd do this type of many-to-many relationship in three
    tables, one for product with ProductID as a primary key, one for color
    with ColorID as a primary key and a third to reference them with just
    two columns, ProductID and ColorID, and a composite key if you need
    it. Your SQL gets a bit more involved but is pretty straight forward
    if you specify tables out of habit, and you can use INNER/OUTER JOIN
    statements to select the proper products for display.

    While you can get really involved in this, most shopping carts would
    have a Product ID, a Color ID and a Size ID (as well as quantity,
    etc.) stored for each record in a transaction table. This is a pretty
    standard product database design for any POS database, whether web or
    brick and mortar. If you do some digging for samples you'll find
    quite a bit available, and the Northwind database sample in
    Microsoft's database products is a great place to start.

    By the way, you *should* have all this design work done before you
    start working on the coding for display, etc. :)

    Jeff
    Jeff Cochran Guest

  7. #6

    Default Re: Shopping cart db design - accounting for product variations

    thanks for clarifying what i thought! by the way, what are SKU??

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    raj k Guest

  8. #7

    Default Re: Shopping cart db design - accounting for product variations

    SKU = product code

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "raj k" <karwalr@hotmail.com> wrote in message
    news:e6FdFoauDHA.1872@TK2MSFTNGP09.phx.gbl...
    > thanks for clarifying what i thought! by the way, what are SKU??
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Aaron Bertrand - MVP Guest

  9. #8

    Default Re: Shopping cart db design - accounting for product variations

    Stock Keeping Unit

    "raj k" <karwalr@hotmail.com> wrote in message
    news:e6FdFoauDHA.1872@TK2MSFTNGP09.phx.gbl...
    > thanks for clarifying what i thought! by the way, what are SKU??
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Raymond D'Anjou \(raydan\) Guest

  10. #9

    Default Re: Shopping cart db design - accounting for product variations

    For a good cheap ASP-based shopping cart, take a look at Candypress
    [url]http://www.candypress.com[/url].

    I think you can download the cart and store front-end for free, which would
    show you the schema they use to solve the product variation issue. It seems
    to be well done (though I don't claim to be an expert on shopping carts).


    "raj" <karwalr@hotmail.com> wrote in message
    news:477bcb83.0312021609.3dfea814@posting.google.c om...
    > Hi
    >
    > im designing a database/asp cart that sells tshirts online. at the
    > moment, each tshirt has a product id which is stored in a table called
    > session_product along with the session_ID.
    >
    > The thing I want to know is how to store the colour variation of each
    > tshirt when a user adds the tshirt to their basket. I dont really
    > want to have to create a new product id for each colour...
    >
    > any help appreciated!

    Paul Woods Guest

  11. #10

    Default Re: Shopping cart db design - accounting for product variations

    On Wed, 03 Dec 2003 06:30:36 -0800, raj k <karwalr@hotmail.com> wrote:
    >thanks for clarifying what i thought! by the way, what are SKU??
    Stock Keeping Unit. Mostly my retail and Point of Sale (POS)
    background peeking through... :)

    Your term would be ProductID.

    Jeff
    Jeff Cochran Guest

  12. #11

    Default Re: Shopping cart db design - accounting for product variations

    Display only one product with no color (group) show, instead of allowing
    user to eneter qty give them a link to a secondary page that gets pass the
    product number to it.
    Then enumerate all products that have the passed product number pickup the
    color from the products row and build a dynamic page showing colour.
    In that page put the colour name and a textbox for quantities with a txtbox
    name of the product id for that colour.
    I actually used a session array to hold product qty and rproductid between
    pages.

    Don

    "raj k" <karwalr@hotmail.com> wrote in message
    news:ONNOHwZuDHA.1596@TK2MSFTNGP10.phx.gbl...
    > Hmm..i see what you mean. The problem that will arise is that when you
    > add the product to the shopping cart (session_product table), how do you
    > know what colour product is added? The product id alone wont give you
    > this.
    >
    > The only way I can think of is to have another table called
    > product_colors which holds a unique Id, productID and colour. The
    > product table can then have a color column which reference the unique ID
    > from the product_color table. This ID would also be added to the
    > session_product table to get the product colour variation..
    >
    > what u think?
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Don Grover Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139