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?
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?
Yes and you will also need modify the source code, esp. ShoppingCart.cs. You could take the Color and Size as a reference.
Sizez and Colors in the ProductVariant table or ColorOptionPrompt and SizeOptionPrompt in the Product table? Which one should I use as example?
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.
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.