As everyone will agree, the current method for handling product attributes is sorely in need of a re-write.
Attributes are not products, nor should they be treated as such. The product table needs normalized and attributes need to exist in their own right.
Here is what I am proposing.
We already have a table for storing all pertitnent product information.
All we would need is an additional two tables.
1.) Attributes: A table for storing product attributes with a foreign key to associate it with a product. The table would need:
-- attribute id ( unique attribute id )
-- attribute product id ( foreign key ie. which product does this attribute belong to? )
-- attribute name ( name of attribute ie. color )
2.) Attribute Values: A table for storing values for an existing attribute from the above attributes table with a foreign key to associate it with an attribute
-- attribute value id ( unique attribute value id )
-- attribute id ( foreign key ie. which attribute does this value belong to? )
-- attribute value ( red )
-- attribute price modifier ( how does it effect product price ie. +2.00 )
As an example:
Product 1 has attribute 1 ( color ) with an attribute value 1 ( red ).
Product 1 has attribute 1 ( color ) with an attribute value 2 ( blue ).
Product 1 has attribute 1 ( color ) with an attribute value 3 ( green).
Product 1 has attribute 2 ( size ) with an attribute value 4 ( small ).
Product 1 has attribute 2 ( size ) with an attribute value 5 ( medium ).
Product 1 has attribute 2 ( size ) with an attribute value 6 ( large ).
an so on...
With the proposed structure, products could have an unlimited number of attributes such as color, size, material, you name it. Each of which could have an unlimited number of values such as red, blue, green, purple what have you. Furthermore, each attribute could have its own select box on the product details page to make attribute selection a simple matter for the customer. Finally, by including a price modifier field in the attribute values table, we could easily have custom prices at the attribute value level ( xxlarge +2.00 ).
Not sure how much time I have to dedicate to this, but I plan to work on it sporadically as time permits.
Also, if anyone sees anything flawed in my proposed logic, please point it out before I get too involved. 