Answer the question
In order to leave comments, you need to log in
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
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
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 questionAsk a Question
731 491 924 answers to any question