A
A
Andrey Eskov2017-06-19 12:02:02
1C-Bitrix
Andrey Eskov, 2017-06-19 12:02:02

How to add all items to a set at once?

Good afternoon. Tell me how in the product card to make sure that all products are added to the set at once?
By default, 3 products are added in the catalog.set.constructor component, and the rest are added below with the add button.
I will be grateful to you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Eskov, 2017-06-19
@taurus2790

It was possible to find how the product is added to the set. And then maybe someone will tell you.
There is a js script in the component template and in it

BX.namespace("BX.Catalog.SetConstructor");

BX.Catalog.SetConstructor = (function()
{
  var SetConstructor = function(params)
  {
            тут код
        }
}

so I found out that the id of the selected elements are stored in this very params.setIds, and what kind of params and where it is filled with data, I can’t understand, tell me.
there is also a method for adding a product this.setIds.push(it product); But again, where can I get the product id in the js file.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question