Click to See Complete Forum and Search --> : product attributes problem ??


PHPycho
09-17-2007, 12:39 AM
Hello forums !!
while trying to design a database for shopping cart i encountered few problems which i am mentioning here.
I had hierarchical level of categories for products for which i designed table as:
id|title|parent_id
Different products under different cateogries has different attributes ie for example products under
'Clothing' has different attributes than products under 'Music'. It means we cant have static form fields for attributes.I tried to
figure out this table for storing products attributes and values
id|category_id|attribute_name|attribute_type
id|attribute_id|attribute_value
I think this is bit tedious in retrieving and displaying the attribute name and its corrsponding form field type, and also tedious in dynamically inserting, updating etc operations
is there any effective methods for such case ??
I would really appreciate if there is alternative.
Thanks in advance for the comments and suggestions.

MrCoder
09-17-2007, 04:28 AM
Group them, for example one group would be "Colour" and would contains "Red", "Blue", "White"..
Another would be "Size" and would contain "Large", "Medium" and "Small".

You would then assign the groups to the products.

You could also add price modifiers to the values such as "Small" would give a £-2 modifier to the products price if selected.