Answer the question
In order to leave comments, you need to log in
Why doesn't filtering work in the smart filter in catalog.section on the news component page?
There is a catalog page with a filter, you need to transfer this filter to another page.
On the catalog page (complex catalog component), this filter works, but when transferred to a page with a complex news component and an internal catalog.section, this smart filter does not work, what could be the problem?
Pluggable filter on the catalog page:
<?$APPLICATION->IncludeComponent(
"bitrix:catalog",
"catalog",
array(
"ACTION_VARIABLE" => "action",
"ADD_ELEMENT_CHAIN" => "N",
"ADD_PICT_PROP" => "-",
"ADD_PROPERTIES_TO_BASKET" => "Y",
"ADD_SECTIONS_CHAIN" => "Y",
"AJAX_MODE" => $ajax,
"AJAX_OPTION_ADDITIONAL" => "",
"AJAX_OPTION_HISTORY" => "Y",
"AJAX_OPTION_JUMP" => "N",
"AJAX_OPTION_STYLE" => "Y",
"CACHE_FILTER" => "N",
"CACHE_GROUPS" => "Y",
"CACHE_TIME" => "36000000",
"CACHE_TYPE" => "A",
"DETAIL_DISPLAY_NAME" => "Y",
"DETAIL_DISPLAY_PREVIEW_TEXT_MODE" => "E",
"DETAIL_IMAGE_RESOLUTION" => "16by9",
"DETAIL_MAIN_BLOCK_OFFERS_PROPERTY_CODE" => "",
"DETAIL_MAIN_BLOCK_PROPERTY_CODE" => "",
"DETAIL_META_DESCRIPTION" => "-",
"DETAIL_META_KEYWORDS" => "-",
"DETAIL_OFFERS_FIELD_CODE" => array(
0 => "TIMESTAMP_X",
1 => "CODE",
2 => "",
),
"DETAIL_OFFERS_PROPERTY_CODE" => array(
0 => "COLOR",
1 => "GALLERY",
),
"DETAIL_PRODUCT_INFO_BLOCK_ORDER" => "sku,props",
"DETAIL_PRODUCT_PAY_BLOCK_ORDER" => "rating,price,priceRanges,quantityLimit,quantity,buttons",
"DETAIL_PROPERTY_CODE" => array(
0 => "",
1 => "",
),
"DETAIL_SET_CANONICAL_URL" => "N",
"DETAIL_SET_VIEWED_IN_COMPONENT" => "N",
"DETAIL_SHOW_POPULAR" => "Y",
"DETAIL_SHOW_SLIDER" => "N",
"DETAIL_SHOW_VIEWED" => "Y",
"DETAIL_STRICT_SECTION_CHECK" => "Y",
"DETAIL_USE_COMMENTS" => "N",
"DETAIL_USE_VOTE_RATING" => "N",
"FILTER_FIELD_CODE" => array(
0 => "",
1 => "",
),
"FILTER_HIDE_ON_MOBILE" => "Y",
"FILTER_NAME" => "sf",
"FILTER_OFFERS_FIELD_CODE" => array(
0 => "PREVIEW_PICTURE",
1 => "",
),
"FILTER_OFFERS_PROPERTY_CODE" => array(
0 => "COLOR",
1 => "",
),
"FILTER_PRICE_CODE" => array(
0 => "BASE",
),
"FILTER_PROPERTY_CODE" => array(
0 => "MATERIAL",
1 => "COATING",
2 => "PROFILE",
3 => "GUARANTEE",
),
"HIDE_NOT_AVAILABLE" => "N",
"HIDE_NOT_AVAILABLE_OFFERS" => "N",
"IBLOCK_ID" => "23",
"IBLOCK_TYPE" => "catalog",
"INCLUDE_SUBSECTIONS" => "Y",
"INSTANT_RELOAD" => "Y",
"LABEL_PROP" => "",
"LAZY_LOAD" => "N",
"LINE_ELEMENT_COUNT" => "3",
"LINK_ELEMENTS_URL" => "link.php?PARENT_ELEMENT_ID=#ELEMENT_ID#",
"LIST_PROPERTY_CODE_MOBILE" => "",
"LIST_SHOW_SLIDER" => "Y",
"LIST_SLIDER_INTERVAL" => "3000",
"LIST_SLIDER_PROGRESS" => "N",
"LOAD_ON_SCROLL" => "N",
"PAGE_ELEMENT_COUNT" => "9",
"PARTIAL_PRODUCT_PROPERTIES" => "N",
"PRODUCT_DISPLAY_MODE" => "N",
"PRODUCT_ID_VARIABLE" => "id",
"PRODUCT_PROPERTIES" => array(
),
"PRODUCT_PROPS_VARIABLE" => "prop",
"PRODUCT_QUANTITY_VARIABLE" => "quantity",
"PRODUCT_SUBSCRIPTION" => "Y",
"SECTIONS_SHOW_PARENT_NAME" => "Y",
"SECTIONS_VIEW_MODE" => "LIST",
"SECTION_ADD_TO_BASKET_ACTION" => "ADD",
"SECTION_BACKGROUND_IMAGE" => "-",
"SECTION_COUNT_ELEMENTS" => "Y",
"SECTION_ID_VARIABLE" => "SECTION_ID",
"SECTION_TOP_DEPTH" => "2",
"SEF_MODE" => "Y",
"SET_LAST_MODIFIED" => "N",
"SET_STATUS_404" => "N",
"SET_TITLE" => "Y",
"SHOW_404" => "N",
"SIDEBAR_DETAIL_SHOW" => "N",
"SIDEBAR_PATH" => "",
"SIDEBAR_SECTION_SHOW" => "Y",
"TEMPLATE_THEME" => "",
"TOP_ELEMENT_COUNT" => "9",
"TOP_PROPERTY_CODE" => array(
0 => "",
1 => "",
),
"TOP_PROPERTY_CODE_MOBILE" => "",
"TOP_SHOW_SLIDER" => "Y",
"TOP_SLIDER_INTERVAL" => "3000",
"TOP_SLIDER_PROGRESS" => "N",
"TOP_VIEW_MODE" => "SECTION",
"USE_COMMON_SETTINGS_BASKET_POPUP" => "N",
"USE_COMPARE" => "N",
"USE_ELEMENT_COUNTER" => "Y",
"USE_ENHANCED_ECOMMERCE" => "N",
"USE_FILTER" => "Y",
"COMPONENT_TEMPLATE" => "catalog",
"SEF_FOLDER" => "/catalog/",
"USE_ALSO_BUY" => "N",
"SEF_URL_TEMPLATES" => array(
"sections" => "",
"section" => "#SECTION_CODE#/",
"element" => "#SECTION_CODE#/#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
);?>
<? $smartFilter = $APPLICATION->IncludeComponent(
"bitrix:catalog.smart.filter2",
"",
array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => IB_OFFER, //$arParams["IBLOCK_ID"],
"SECTION_ID" => $arResult["VARIABLES"]["SECTION_ID"],
"SECTION_CODE" => $arResult["VARIABLES"]["SECTION_CODE"],
"FILTER_NAME" => $arParams["FILTER_NAME"],
"EX_FILTER_PARAMS" => $arParams["EX_FILTER_PARAMS"],
"EX_FILTER_URL" => $arParams["EX_FILTER_URL"],
"DISPLAY_ELEMENT_COUNT" => 'N',
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"SAVE_IN_SESSION" => "N",
"FILTER_VIEW_MODE" => $arParams["FILTER_VIEW_MODE"],
"XML_EXPORT" => "Y",
"SECTION_TITLE" => "NAME",
"SECTION_DESCRIPTION" => "DESCRIPTION",
'HIDE_NOT_AVAILABLE' => 'Y',//$arParams["HIDE_NOT_AVAILABLE"],
"TEMPLATE_THEME" => $arParams["TEMPLATE_THEME"],
'CONVERT_CURRENCY' => $arParams['CONVERT_CURRENCY'],
'CURRENCY_ID' => $arParams['CURRENCY_ID'],
"SEF_MODE" => "N",
"SEF_RULE" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["smart_filter"],
"SMART_FILTER_PATH" => $arResult["VARIABLES"]["SMART_FILTER_PATH"],
"PAGER_PARAMS_NAME" => $arParams["PAGER_PARAMS_NAME"],
"INSTANT_RELOAD" => $arParams["INSTANT_RELOAD"],
"PAGE_ELEMENT_COUNT" => $arParams["PAGE_ELEMENT_COUNT"],
"DISPLAY" => $display,
),
$component,
array('HIDE_ICONS' => 'Y')
); ?>
$APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"",
array(
"DISPLAY" => $display,
'FILTER' => $GLOBALS[$arParams["FILTER_NAME"]],
"AJAX_MODE" => $arParams["AJAX_MODE"],
"SECTION_ID" => $section->ID,
"PAGE_ELEMENT_COUNT" => $arParams["PAGE_ELEMENT_COUNT"],
"REGION" => $city["REGION"],
),
$component,
array('HIDE_ICONS' => 'Y')
);
<?$APPLICATION->IncludeComponent(
"bitrix:news",
"city",
Array(
"ADD_ELEMENT_CHAIN" => "N",
"ADD_SECTIONS_CHAIN" => "N",
"AJAX_MODE" => $ajax,
"AJAX_OPTION_ADDITIONAL" => "",
"AJAX_OPTION_HISTORY" => "Y",
"AJAX_OPTION_JUMP" => "N",
"AJAX_OPTION_STYLE" => "Y",
"BROWSER_TITLE" => "-",
"CACHE_FILTER" => "Y",
"CACHE_GROUPS" => "Y",
"CACHE_TIME" => "36000000",
"CACHE_TYPE" => "A",
"CHECK_DATES" => "Y",
"HIDE_LINK_WHEN_NO_DETAIL" => "N",
"IBLOCK_ID" => "15",
"IBLOCK_TYPE" => "reference",
"INCLUDE_IBLOCK_INTO_CHAIN" => "N",
"LIST_ACTIVE_DATE_FORMAT" => "d.m.Y",
"LIST_FIELD_CODE" => array("",""),
"LIST_PROPERTY_CODE" => array("ARTICLES","PRIORITY"),
"NEWS_COUNT" => "20",
"PAGER_BASE_LINK_ENABLE" => "N",
"PAGER_DESC_NUMBERING" => "N",
"PAGER_DESC_NUMBERING_CACHE_TIME" => "36000",
"PAGER_SHOW_ALL" => "N",
"PAGER_SHOW_ALWAYS" => "N",
"PAGER_TEMPLATE" => ".default",
"PAGER_TITLE" => "Новости",
"PREVIEW_TRUNCATE_LEN" => "",
"SEF_FOLDER" => "/buy/",
"SEF_MODE" => "Y",
"SEF_URL_TEMPLATES" => Array("detail"=>"#ELEMENT_CODE#/","news"=>"","section"=>"", "smart_filter" => "#SECTION_ID#/filter/#SMART_FILTER_PATH#/apply/",),
"SET_LAST_MODIFIED" => "N",
"SET_STATUS_404" => $echo ? "N" : "Y",
"SET_TITLE" => "N",
"SHOW_404" => $echo ? "N" : "Y",
"SORT_BY1" => "SORT",
"SORT_BY2" => "SORT",
"SORT_ORDER1" => "ASC",
"SORT_ORDER2" => "ASC",
"STRICT_SECTION_CHECK" => "N",
"USE_CATEGORIES" => "N",
"USE_FILTER" => "Y",
"FILTER_FIELD_CODE" => array(
0 => "",
1 => "",
),
"FILTER_HIDE_ON_MOBILE" => "Y",
"FILTER_NAME" => "sf",
"FILTER_OFFERS_FIELD_CODE" => array(
0 => "PREVIEW_PICTURE",
1 => "",
),
"FILTER_OFFERS_PROPERTY_CODE" => array(
0 => "COLOR",
1 => "",
),
"FILTER_PRICE_CODE" => array(
0 => "BASE",
),
"FILTER_PROPERTY_CODE" => array(
0 => "MATERIAL",
1 => "COATING",
2 => "PROFILE",
3 => "GUARANTEE",
),
"FILTER_VIEW_MODE" => "VERTICAL",
"USE_PERMISSIONS" => "N",
"USE_RATING" => "N",
"USE_RSS" => "N",
"USE_SEARCH" => "N",
"USE_SHARE" => "N"
)
);?>
<? $smartFilter = $APPLICATION->IncludeComponent(
"bitrix:catalog.smart.filter2",
"city-filter",
array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => IB_OFFER, //$arParams["IBLOCK_ID"],
"SECTION_ID" => $arResult["VARIABLES"]["SECTION_ID"],
"SECTION_CODE" => $arResult["VARIABLES"]["SECTION_CODE"],
"FILTER_NAME" => $arParams["FILTER_NAME"],
"EX_FILTER_PARAMS" => $arParams["EX_FILTER_PARAMS"],
"EX_FILTER_URL" => $arParams["EX_FILTER_URL"],
"DISPLAY_ELEMENT_COUNT" => 'N',
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"SAVE_IN_SESSION" => "N",
"FILTER_VIEW_MODE" => $arParams["FILTER_VIEW_MODE"],
"XML_EXPORT" => "Y",
"SECTION_TITLE" => "NAME",
"SECTION_DESCRIPTION" => "DESCRIPTION",
'HIDE_NOT_AVAILABLE' => 'Y',//$arParams["HIDE_NOT_AVAILABLE"],
"TEMPLATE_THEME" => $arParams["TEMPLATE_THEME"],
'CONVERT_CURRENCY' => $arParams['CONVERT_CURRENCY'],
'CURRENCY_ID' => $arParams['CURRENCY_ID'],
"SEF_MODE" => "N",
"SEF_RULE" => $arResult["FOLDER"] . $arResult["URL_TEMPLATES"]["smart_filter"],
"SMART_FILTER_PATH" => $arResult["VARIABLES"]["SMART_FILTER_PATH"],
"PAGER_PARAMS_NAME" => $arParams["PAGER_PARAMS_NAME"],
"INSTANT_RELOAD" => $arParams["INSTANT_RELOAD"],
"PAGE_ELEMENT_COUNT" => $arParams["PAGE_ELEMENT_COUNT"],
"DISPLAY" => $display,
),
$component,
array('HIDE_ICONS' => 'Y')
);
$APPLICATION->IncludeComponent(
"bitrix:catalog.section",
"material",
array(
"DISPLAY" => $display,
'FILTER' => $GLOBALS[$arParams["FILTER_NAME"]],
"AJAX_MODE" => $arParams["AJAX_MODE"],
"SECTION_ID" => $section->ID,
"PAGE_ELEMENT_COUNT" => $arParams["PAGE_ELEMENT_COUNT"],
"REGION" => $city["REGION"],
"NEED_PAGER" => 'Y'
),
$component,
array('HIDE_ICONS' => 'Y')
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question