J
J
jakuraji2019-03-05 18:29:27
Database design
jakuraji, 2019-03-05 18:29:27

How to design "product options" in an online store?

How to design an online store with a simple list of products - I know. It's done. The fun starts when you now need to add possibly "custom properties" to products. That is, it can be a) color b) size - for example.
Depending on these characteristics and their combinations, the price may differ. The title too. Pictures too. Availability in stock.
How to make it easier and more correct? Just add a ProductCustomProperties child table with a link to Products and move the price, name, etc. into her?
Also! Not all products I have can have CustomProperties. That is, for example, some kind of "Hand Cream" - I always have it with one modification, or without modifications - which is the same thing. How to be here?
What are your tips? Who did this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Tsvetkov, 2019-03-05
@jakuraji

You add two tables, one with links of modifier id and product id, another table of modifier id, customPropertyKey, customPropertyValue

S
sim3x, 2019-03-05
@sim3x

EAV
json
In a good way, you should have an understanding that you have a SKU
And then, starting from this knowledge and accounting requirements (accounting and warehouse), design something

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question