L
L
leracoder2020-02-10 12:14:32
1C-Bitrix
leracoder, 2020-02-10 12:14:32

How to display “leaders of sales” for the current section in 1s Bitrix?

In the online store, each product below offers "Top Sellers" (of the entire site), the bitrix:sale.bestsellers component is used.
The following question arose:
How to configure the component so that for a given product "Top Sellers" are displayed not from the entire site, but from the section to which it belongs?

I tried to change the property "SHOW_PRODUCTS_2" (where 2 is the id of the infoblock) to "SHOW_PRODUCTS_1679" (where 1679 is the id of a specific section). nothing is displayed..

I tried to write to the filter:
SECTION_ID"=>$_GET["SECTION_ID"]);
"FILTER" => "arrFilter", also nothing

Please tell me what I'm doing wrong? what other ways are there?
Used this documentation : https://dev.There is not much experience in Bitrix yet.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Alexandrov, 2020-02-10
@leracoder

In the documentation, if you read carefully, there is no support for sections and no filter support, the FILTER key is a filter by order status.
As an option, in the $arResult of this component, each sold product has [IBLOCK_SECTION_ID], plus you can pass the value of the complex component to the parameters in element.php $arParams['SECTION_ID_VARIABLE'],
In the template itself, compare the values ​​of [IBLOCK_SECTION_ID] with the current SECTION_ID_VARIABLE and hide products whose value does not match.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question