Forum Moderators: open
The need:
I have a catalog table with parent chilled relations with it I can sort the catalog to categories.
I would like to add features for the items such as Brand, color, type, price range, etc and be able to do sorting by these features.
The admin of the catalog must be able to create new features and define possible values e.g.
Feature name: available color
Possible values: red, green…..
More over, when selecting features to an item it will be possible to select more than one value (in the previous example, choose both red and green).
The database structure:
I am going to create new table named features, this table will have the fields:
id, owner, name, possible values
when the admin creates new feature an new row is added to this table with all the information, the owner value will be an id of item/category in the catalog table.
if I add new item to certain category, I will be able to select values from all the features that this category is it's owner.
Here comes my question:
How do I relate the item to it's features name-value that I selected for it?
Especially, how do id that keeping in mined the need to sort by the features values, e.g. available colors->price range->…..
Did anyone did such sorting by features? What are your recommendations?
thanks