I
I
Ilya2018-05-21 21:45:52
MySQL
Ilya, 2018-05-21 21:45:52

How can I design an online store database with product options?

Good day.
Can anyone suggest a database schema for an online shop with an EAV model and the ability to combine product characteristics into additional entities that may have a separate price.
The system is utterly simple, but something stupid. Let's say we have the sizes of goods (rings) 15,16,17,18, ... 25 let it be, the trick is that they can have a different price (precious metal consumption and other reasons known only to the manufacturer). Of course, you can stupidly create one additional table, where you roughly write the itemID, size, price, it's cool, but what if you need to combine it with any other characteristic, for example, with the "stones" text field. Another option is already obtained: Size, precious stone, price.
The store is 4 years old and made in combination MODx EVO + crutches. In practice, such options will know for sure, the work will not be in vain. And yes, I understand that doing another shop on Laravel does not make sense for many, it’s easier to download opencart or buy Bitrix, but there will be other troubles (initially they wanted to put it on opencart, it didn’t fit), this will not go anywhere.
They didn’t ban me on Google, I google as best I can, but mostly simple schemes come across. Either all the characteristics in general in one products table, or the EAV model, but there are no options with different prices. In general, we need help, advice, moral support =). Link to my scheme: www.laravelsd.com/share/ZjzprC (if anyone needs it, it can be forked and edited). You can not take it as a basis, just sketched.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shamanov, 2018-05-22
@SilenceOfWinter

roughly speaking:
products (id, name) - products
features (id, name) - features
feature_values ​​(id, feature_id, value) - feature values
​​product_skus (id, product_id, name, price, qty) -
SKU_features (sku_id, feature_id, feature_value_id) - article characteristics

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question