M
M
Maxim Osadchy2018-11-05 20:18:13
Yii
Maxim Osadchy, 2018-11-05 20:18:13

How are Variable Products Made?

That is, those whose attributes change the price.
For example, a black phone costs 800 rubles, a white one costs 1200.
For these options, I have an intermediate table that stores the product id, attribute id, attribute value and price for it.
If earlier, when adding a product to the cart, the id and quantity were sent to the session, and the price of the product was already pulled on the server, now, for example, I can do the following:
Display the checkboxes of the option in the product card, and on click, substitute the price for this attribute in a certain div , and it is already sent to the session along with information on the option. I think the option will work, but I'm afraid that the idea is a crutch, I would like to know the best practices.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2018-11-06
@dimonchik2013

price = article, nothing else
for attributes - faceted search

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question