T
T
TotTip2020-06-18 13:42:44
1C-Bitrix
TotTip, 2020-06-18 13:42:44

How to connect bitrix smart filter correctly?

Hello!
unable to properly connect smart filter
component connection code taken here
https://dev.1c-bitrix.ru/user_help/components/cont...

filter component connection

<?$APPLICATION->IncludeComponent(
    "bitrix:catalog.smart.filter", 
    "", 
    array(
        "COMPONENT_TEMPLATE" => visual_horizontal,
        "IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
        "IBLOCK_ID" => $arParams["IBLOCK_ID"],
        "SECTION_ID" => $arParams["SECTION_ID"],
        "SECTION_CODE" => $arParams["SECTION_CODE"],
        "FILTER_NAME" => $arParams["FILTER_NAME"],
        "HIDE_NOT_AVAILABLE" => "N",
        "TEMPLATE_THEME" => "default",
        "FILTER_VIEW_MODE" => "horizontal",
        "DISPLAY_ELEMENT_COUNT" => "Y",
        "SEF_MODE" => "Y",
        "CACHE_TYPE" => $arParams["CACHE_TYPE"],
        "CACHE_TIME" => $arParams["CACHE_TIME"],
  "CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
        "SAVE_IN_SESSION" => "N",
        "INSTANT_RELOAD" => "Y",
        "PAGER_PARAMS_NAME" => "arrPager",
        "PRICE_CODE" => $arParams["PRICE_CODE"],
        'CONVERT_CURRENCY' => $arParams['CONVERT_CURRENCY'],
  'CURRENCY_ID' => $arParams['CURRENCY_ID'],
        "XML_EXPORT" => "N",
        "SECTION_TITLE" => "-",
        "SECTION_DESCRIPTION" => "-",
        "POPUP_POSITION" => "left",
  "SEF_RULE" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["smart_filter"],
  "SMART_FILTER_PATH" => $arResult["VARIABLES"]["SMART_FILTER_PATH"],
  "PAGER_PARAMS_NAME" => $arParams["PAGER_PARAMS_NAME"],
        "CURRENCY_ID" => "RUB"
    ),
    false
);?>


The filter was displayed with the properties I needed, but when I try to change the values ​​in the filter - in the popup with the result it is displayed - "Selected 0"
When you click on "Show" it sends you to the 404 page (the link looks like this /catalog/filter/square-from-71.531/ apply/)

Here is the connection of the directory component itself

<?$APPLICATION->IncludeComponent(
  "bitrix:catalog", 
  "catalog", 
  array(
    "DETAIL_SHOW_PICTURE" => "Y",
    "USER_CONSENT" => "N",
    "AJAX_MODE" => "N",
    "SEF_MODE" => "Y",
    "IBLOCK_TYPE" => "catalog",
    "IBLOCK_ID" => "3",
    "USE_FILTER" => "Y",
    "USE_COMPARE" => "N",
    "SHOW_TOP_ELEMENTS" => "N",
    "SECTION_COUNT_ELEMENTS" => "Y",
    "SECTION_TOP_DEPTH" => "2",
    "PAGE_ELEMENT_COUNT" => "30",
    "LINE_ELEMENT_COUNT" => "3",
    "ELEMENT_SORT_FIELD" => "sort",
    "ELEMENT_SORT_ORDER" => "asc",
    "ELEMENT_SORT_FIELD2" => "id",
    "ELEMENT_SORT_ORDER2" => "desc",
    "LIST_PROPERTY_CODE" => array(
      0 => "in_index",
      1 => "price",
      2 => "",
    ),
    "INCLUDE_SUBSECTIONS" => "Y",
    "USE_MAIN_ELEMENT_SECTION" => "N",
    "DETAIL_STRICT_SECTION_CHECK" => "N",
    "LIST_META_KEYWORDS" => "-",
    "LIST_META_DESCRIPTION" => "-",
    "LIST_BROWSER_TITLE" => "-",
    "SECTION_BACKGROUND_IMAGE" => "-",
    "DETAIL_PROPERTY_CODE" => array(
      0 => "in_index",
      1 => "SQUARE",
      2 => "objs",
      3 => "SIZE",
      4 => "price",
      5 => "PRICE_PEN",
      6 => "PRICE_SIP",
      7 => "",
    ),
    "DETAIL_META_KEYWORDS" => "-",
    "DETAIL_META_DESCRIPTION" => "-",
    "DETAIL_BROWSER_TITLE" => "-",
    "DETAIL_SET_CANONICAL_URL" => "N",
    "SECTION_ID_VARIABLE" => "SECTION_ID",
    "DETAIL_CHECK_SECTION_ID_VARIABLE" => "N",
    "DETAIL_BACKGROUND_IMAGE" => "-",
    "SHOW_DEACTIVATED" => "N",
    "CACHE_TYPE" => "N",
    "CACHE_TIME" => "36000000",
    "CACHE_NOTES" => "",
    "CACHE_FILTER" => "N",
    "CACHE_GROUPS" => "Y",
    "SET_LAST_MODIFIED" => "N",
    "SET_TITLE" => "Y",
    "ADD_SECTIONS_CHAIN" => "Y",
    "ADD_ELEMENT_CHAIN" => "Y",
    "PRICE_CODE" => array(
    ),
    "USE_PRICE_COUNT" => "N",
    "SHOW_PRICE_COUNT" => "1",
    "PRICE_VAT_INCLUDE" => "Y",
    "PRICE_VAT_SHOW_VALUE" => "N",
    "BASKET_URL" => "/personal/basket.php",
    "ACTION_VARIABLE" => "action",
    "PRODUCT_ID_VARIABLE" => "id",
    "USE_PRODUCT_QUANTITY" => "N",
    "ADD_PROPERTIES_TO_BASKET" => "Y",
    "PRODUCT_PROPS_VARIABLE" => "prop",
    "PARTIAL_PRODUCT_PROPERTIES" => "N",
    "PRODUCT_PROPERTIES" => array(
    ),
    "LINK_IBLOCK_TYPE" => "",
    "LINK_IBLOCK_ID" => "",
    "LINK_PROPERTY_SID" => "",
    "LINK_ELEMENTS_URL" => "link.php?PARENT_ELEMENT_ID=#ELEMENT_ID#",
    "USE_STORE" => "N",
    "COMPATIBLE_MODE" => "Y",
    "USE_ELEMENT_COUNTER" => "Y",
    "DISABLE_INIT_JS_IN_COMPONENT" => "N",
    "PAGER_TEMPLATE" => ".default",
    "DISPLAY_TOP_PAGER" => "N",
    "DISPLAY_BOTTOM_PAGER" => "Y",
    "PAGER_TITLE" => "Проекты",
    "PAGER_SHOW_ALWAYS" => "N",
    "PAGER_DESC_NUMBERING" => "N",
    "PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
    "PAGER_SHOW_ALL" => "N",
    "PAGER_BASE_LINK_ENABLE" => "N",
    "SET_STATUS_404" => "Y",
    "SHOW_404" => "N",
    "MESSAGE_404" => "",
    "USER_CONSENT_ID" => "0",
    "USER_CONSENT_IS_CHECKED" => "Y",
    "USER_CONSENT_IS_LOADED" => "N",
    "AJAX_OPTION_JUMP" => "N",
    "AJAX_OPTION_STYLE" => "N",
    "AJAX_OPTION_HISTORY" => "N",
    "SEF_FOLDER" => "/catalog/",
    "COMPOSITE_FRAME_MODE" => "A",
    "COMPOSITE_FRAME_TYPE" => "AUTO",
    "COMPONENT_TEMPLATE" => "catalog",
    "AJAX_OPTION_ADDITIONAL" => "",
    "PRODUCT_QUANTITY_VARIABLE" => "quantity",
    "FILTER_NAME" => "",
    "FILTER_FIELD_CODE" => array(
      0 => "",
      1 => "",
    ),
    "FILTER_PROPERTY_CODE" => array(
      0 => "price",
      1 => "",
    ),
    "FILTER_PRICE_CODE" => "",
    "SEF_URL_TEMPLATES" => array(
      "sections" => "",
      "section" => "#SECTION_CODE_PATH#/",
      "element" => "product/#ELEMENT_CODE#/",
      "compare" => "compare.php?action=#ACTION_CODE#",
      "smart_filter" => "#SECTION_ID#/filter/#SMART_FILTER_PATH#/apply/",
    ),
    "VARIABLE_ALIASES" => array(
      "compare" => array(
        "ACTION_CODE" => "action",
      ),
    )
  ),
  false
);?>



What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question