Answer the question
In order to leave comments, you need to log in
How to properly design product parameters for categories in an online store?
Good afternoon.
Interested in opinion and experience in designing an online store.
Brief:
Each product belongs to a specific category.
Therefore, each product has its own special attributes depending on the categories.
For example:
Tires: width, height, diameter, drilling.
Clothes: size, color.
Each attribute can be hard-selected from select.
Implementation:
1) Dynamic
We have two tables
item_category_property (id, category, name, values (ser. array of values for select / checkbox)
item_property_value (id, item_category_property, item, values
Plus - it's easy to generate attributes for each category from the admin panel.
Cons - with large volumes, stupidity in the samples. You can not sharpen the interface in the administrative part for more convenient use
2) Statics
One table item_category_XX (Where xx is the category id). We will store already predefined data types, which will allow us to conveniently design the interface and write business logic.
Cons - with the n-th number of categories for each category, it is inconvenient to create a table (you will have to do it yourself at the database level)
How to store links at the program level in order to do JOIN?
A category can be a child, so the parent relationship also has common parameters.
Are there any universal options?
Answer the question
In order to leave comments, you need to log in
attribute_group [id, name, order]
attribute [id, group_id, name, order]
attribute_value [id, value]
product_attribute [product_id, attribute_id, attribute_value_id]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question