Answer the question
In order to leave comments, you need to log in
How to filter by section name?
Help me make a filter, please!
<?$GLOBALS['work'] = $arResult["SECTION"]["PATH"][0]["NAME"];?>
<?$work = $GLOBALS['work'];?>
<?$GLOBALS ["work"] = array('PROPERTY_TYPE_WORK_VALUE' => $work);?>
<?$APPLICATION->IncludeComponent("bitrix:catalog.sections.top","",Array(
"IBLOCK_TYPE" => "",
"IBLOCK_ID" => "4",
"SECTION_FIELDS" => Array(""),
"SECTION_USER_FIELDS" => Array(""),
"SECTION_SORT_FIELD" => "sort",
"SECTION_SORT_ORDER" => "asc",
"ELEMENT_SORT_FIELD" => "sort",
"ELEMENT_SORT_ORDER" => "asc",
"ELEMENT_SORT_FIELD" => "active_from",
"ELEMENT_SORT_ORDER" => "asc",
"FILTER_NAME" => "work",
"SECTION_URL" => "",
"DETAIL_URL" => "",
"BASKET_URL" => "/personal/basket.php",
"ACTION_VARIABLE" => "action",
"PRODUCT_ID_VARIABLE" => "id",
"PRODUCT_QUANTITY_VARIABLE" => "quantity",
"PRODUCT_PROPS_VARIABLE" => "prop",
"SECTION_ID_VARIABLE" => "SECTION_ID",
"DISPLAY_COMPARE" => "Y",
"USE_MAIN_ELEMENT_SECTION" => "Y",
"SECTION_COUNT" => "3",
"ELEMENT_COUNT" => "3",
"LINE_ELEMENT_COUNT" => "3",
"PROPERTY_CODE" => Array("PRICE", "TYPE_WORK"),
"PRICE_CODE" => Array("BASE"),
"USE_PRICE_COUNT" => "Y",
"SHOW_PRICE_COUNT" => "1",
"PRICE_VAT_INCLUDE" => "Y",
"PRODUCT_PROPERTIES" => array(),
"USE_PRODUCT_QUANTITY" => "Y",
"CACHE_TYPE" => "A",
"CACHE_TIME" => "3600",
"CACHE_FILTER" => "Y",
"CACHE_GROUPS" => "Y",
"HIDE_NOT_AVAILABLE" => "N",
"QUANTITY_FLOAT" => "N",
"CONVERT_CURRENCY" => "Y",
"CURRENCY_ID" => "RUB",
)
);?>
"NAME" => $arResult["NAME"] - фильтрует по названию элемента,
а не по названию раздела
Answer the question
In order to leave comments, you need to log in
Sorry, you can't filter by title. Judging by your code, filtering by section id will suit you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question