Answer the question
In order to leave comments, you need to log in
How to parse the Bitrix filter parameters?
Good afternoon.
It is necessary to set up analytics on the Bitrix filter (you can’t do it by urls - there is logic).
Tell me how you can get the selected data in the Bitrix filter, maybe there is an array with the selected parameters or something else?
I don't want to cheat and parse the url as a string, thanks.
Answer the question
In order to leave comments, you need to log in
The arResult of the catalog.smart.filter template has everything. If data is needed outside the template, then in result_modifier form an array with the necessary data, add it to arResult. Pass the key of the added array to SetResultCacheKeys, and in component_epilog make a global variable with this data.
result_modifier.php
$customFields = [];//Ваши данные
/** @var CBitrixComponent $component */
$component = $this->__component;
$component->setResultCacheKeys(["CUSTOM_FIELDS"]);
global $customFields ;
$customFields = $arResult["CUSTOM_FIELDS"];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question