Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 5 of 5

Thread: New Attributes

  1. #1
    ram is offline Senior Member
    Join Date
    Oct 2007
    Posts
    153

    Default New Attributes

    We would like to add more attributes for each item. In that case, do we need to create new columns in the database and also change the xml package/stored procedures to display them?

  2. #2
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Yes and you will also need modify the source code, esp. ShoppingCart.cs. You could take the Color and Size as a reference.

  3. #3
    ram is offline Senior Member
    Join Date
    Oct 2007
    Posts
    153

    Default

    Sizez and Colors in the ProductVariant table or ColorOptionPrompt and SizeOptionPrompt in the Product table? Which one should I use as example?

  4. #4
    ram is offline Senior Member
    Join Date
    Oct 2007
    Posts
    153

    Default

    Some items have 5 attributes and some items have 15. Also, the attributes differ for each item. For example, paper will have different attributes and binder will have different attributes. In this case, how will you store them in the database?
    Last edited by ram; 12-08-2009 at 12:56 PM.

  5. #5
    Jao is offline Senior Member
    Join Date
    Oct 2008
    Posts
    1,132

    Default

    Well, the systematic resolution would be to create two tables, say, ProductAttributes and AttributesLookup, consisting of the following column...

    ATTRIBUTESLOOKUP
    AttributeID
    Attribute
    Value

    PRODUCTATTRIBUTES
    VariantID
    Attributes

    so for example:
    We have Variant ID: 1, which is in need of Color (white and black) and Size (small and big)
    VariantID 2: Color (black, red), Size (small, big) and Material (wood, plastic)

    ATTRIBUTESLOOKUP
    AttributeID | Attribute | Value
    1 | Color | White
    2 | Color | Black
    3 | Color | Red
    4 | Size | Small
    5 | Size | Big
    6 | Size | Medium
    7 | Material | Wood
    8 | Material | Plastic
    9 | Material | Metal


    PRODUCTATTRIBUTES
    VariantID | Attributes
    1 | 1, 2, 4, 5
    2 | 2, 3, 4, 5, 7, 9

    However, this would need massive modification; the brighter side though is that this offers a lot of flexibility...
    Last edited by Jao; 12-10-2009 at 03:14 PM.