A
A
Artem2020-12-17 01:15:20
1C-Bitrix
Artem, 2020-12-17 01:15:20

How to hide those property values ​​in the filter that the products in the selected section do not have?

On Zen , I found an article about a smart filter and was interested in the item highlighted in the image below under the spoiler.

Excerpt from Zen article
5fda831d598ca461118640.jpeg

After this / instruction article was found on the Bitrix website.
Excerpt from an article on the Bitrix forum
5fda84536ca55005742176.jpeg

But it describes a separate display of properties in the store edition, in my case, the Start edition.
After a long search and questions, I did not find an answer on how to do this, all the solutions and recommendations that were found did not work (it is quite possible that because of my meager knowledge about Bitrix).

Please advise how to do this. I don't understand myself and have already broken my whole head.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem, 2021-01-10
@avgustov

As a result, the solution turned out to be quite simple (even if the template is a crutch).
You need to use the solution with the output of a smart filter anywhere on the page.

The code to be inserted before the complex component that contains the output of the products (in my case it is news.list)

<? ob_start();
$APPLICATION->IncludeComponent(
  "bitrix:catalog.smart.filter",
  "",
  array(
    ......
    "SECTION_ID" => $_REQUEST["SECTION_ID"],///передать id раздела в умный фильтр
    ......
),
$component,
array('HIDE_ICONS' => 'Y')
);
$GLOBALS['smart_filter'] = ob_get_contents();
ob_end_clean();
?>


Then you need to add this code in the right place of the component template. <?=$GLOBALS['smart_filter']?>
This solution works on any template (I personally tested it on three different ones)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question