G
G
Gennady Dorokhin2020-12-21 20:39:06
1C-Bitrix
Gennady Dorokhin, 2020-12-21 20:39:06

How to make the search fields in the Bitrix Smart Filter show regardless of the presence of objects in the directory?

Real estate agency website, there is a search form with different tabs.
If there is not 1 object in the "Garages" category, it is necessary that the fields do not disappear. Is it possible to do so? That is, I want to specify which fields should always be displayed in the category and everything so that they are rigidly fixed.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton, 2020-12-22
@eXtatic

Good afternoon.
I hope you haven't listened to the advice of your colleagues yet and haven't started redoing the filter logic , because the display of properties that have no values ​​is just built into the template:
Find in your template something like this:

foreach($arResult["ITEMS"] as $key=>$arItem)
      {
        if(
          empty($arItem["VALUES"])
          || isset($arItem["PRICE"])
        )
          continue;

and remove the check for emptiness, it should be like this:
foreach($arResult["ITEMS"] as $key=>$arItem)
      {
        if(
                       isset($arItem["PRICE"])
        )
          continue;

Path to the file
bitrix/templates/template/components/bitrix/catalog.smart.filter/template/template.php
spoiler
5fe22865a8603773612085.jpeg

A
Alexander, 2020-12-22
@kikher

replace the smart filter with a simple one, you can customize the display of fields there.
or change the logic (rewrite) smart filter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question