Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question