E
E
Evgeny Nikolaev2019-06-28 13:22:10
1C-Bitrix
Evgeny Nikolaev, 2019-06-28 13:22:10

How to limit the data in the smart.filter filter to only the product properties passed in the $arrFilter array (whose name is passed to FILTER_NAME)?

An array with a filter is created, namely the code:
global $arrFilter;
$arrFilter = array();
$arrFilter["=ID"] = $myGetBasketData->getProductIdDiscontAr();// this array contains Ids of products with discounts
Next, this array is passed to the bitrix catalog complex component, namely via FILTER_NAME:
$APPLICATION->IncludeComponent(
"bitrix :catalog",
"new_catalog",
array(
"FILTER_NAME" => "arrFilter",
...
The complex catalog component includes inside catalog.smart.filter, namely
$APPLICATION->IncludeComponent(
"bitrix:catalog.smart.filter" ,
"
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"SECTION_ID" => $arCurSection['ID'],
"FILTER_NAME" => $arParams["FILTER_NAME" ],
Checked that $arParams["FILTER_NAME"] contains the string "arrFilter"
With all of the above, the catalog complex component displays the products specified in $arrFilter["=ID"] (i.e. discounted products), and the filter by properties (Dimensions, materials, etc.) is generated from all 50+ products available in the catalog infoblock.
How to limit the data in the filter to data related exclusively to discounted products (that is, the id of which is contained in $arrFilter["=ID"]).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
I'm Yoda, 2019-06-28
@Anadi

If you do not have an ancient version of Bitrix, then you can use the "PREFILTER_NAME" parameter for the smart filter .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question