M
M
miniven2017-09-26 14:33:36
PHP
miniven, 2017-09-26 14:33:36

How to implement the selection of a trade offer in the product card?

Tell me how you can implement such a thing: its parameters are indicated in the product card. The product has trade offers. Need to implement the ability to select a specific offer by parameters (for example, I click on the width parameter and all available width options drop out there)? Accordingly, the order button for a specific selected offer is loaded.
I would be grateful for any ideas

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
oh, 2017-09-26
well @AnneSmith

nothing complicated
if your parameters do not change every minute, then all data can be packed into json, and then dynamically loaded to the selects, and the selects themselves also dynamically open with the desired value and the on change event
, you don’t need to load a separate button for each option, just one buttons for submitting the form
if the parameters change often, then you will have to climb ajax stake every time
examples can be easily found on similar sites

A
Alexander Filippenko, 2017-09-26
@alexfilus

The question is too complex to give a short answer.
All the necessary data is in the arResult array, you need to pass them to JS and create a switch that will allow you to select the ID of the desired TP and add it to the cart.
You can see the implementation in the standard catalog.element template. Or in one of the popular ready-made solutions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question