P
P
Pavel Gogolinsky2016-03-22 18:25:37
PHP
Pavel Gogolinsky, 2016-03-22 18:25:37

How to store links to the same products of different colors?

There is an online shoe store. In the admin panel, you need to implement a combination of products that differ only in color and offer to see other colors of the product on the site. Here is an example.
3533e373c2984cd09bb8047fc8065211.png
How is it best to store such a relationship of goods in the database?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Kobzarev, 2016-03-22
@mihdan

In this case, variability can be implemented by a parent-link, each new color is a separate record in the table in the parent_id field of which the identifier of the parent product is shown. This is the easiest option. There are other options where you can create tables with product attributes and a table of attributes and product links.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question