R
R
ragnar_ok2020-01-17 10:56:37
1C-Bitrix
ragnar_ok, 2020-01-17 10:56:37

Smart filter: how to set default value for input?

Bitrix:catalog.smart.filter is used .
bitrix:catalog.smart.filter processes $_REQUESTand sets the currently selected variant depending on its content. You need to set a default value for the filter input. Currently, no option is selected by default.
How to set default value for smart filter?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ragnar_ok, 2020-01-18
@ragnar_ok

You need to customize the component.
catalog.smart.filter/component.php:416

if (empty($_CHECK)) {
  $arResult["ITEMS"][$PID]["VALUES"][array_key_first($arResult["ITEMS"][$PID]["VALUES"])]["CHECKED"] = true;
  $arResult["ITEMS"][$PID]["DISPLAY_EXPANDED"] = "Y";
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question