Answer the question
In order to leave comments, you need to log in
How to get the ID of the current open product category in Bitrix?
I want to display subcategories for each product category.
I do it like this:
$APPLICATION->IncludeComponent(
"bitrix:catalog.section.list",
"template1",
array(
"ADD_SECTIONS_CHAIN" => "Y",
"CACHE_FILTER" => "N",
"CACHE_GROUPS" => "Y",
"CACHE_TIME" => "36000000",
"CACHE_TYPE" => "A",
"COMPONENT_TEMPLATE" => "template1",
"COUNT_ELEMENTS" => "Y",
"FILTER_NAME" => "sectionsFilter",
"HIDE_SECTION_NAME" => "N",
"IBLOCK_ID" => "4",
"IBLOCK_TYPE" => "catalog",
"SECTION_CODE" => $_REQUEST["SECTION_CODE"],
"SECTION_FIELDS" => array(
0 => "NAME",
1 => "PICTURE",
2 => "",
),
"SECTION_ID" => ,
"SECTION_URL" => "/catalog/#SECTION_CODE#/",
"SECTION_USER_FIELDS" => array(
0 => "",
1 => "",
),
"SHOW_PARENT_NAME" => "Y",
"TOP_DEPTH" => "3",
"VIEW_MODE" => "TILE"
),
false
); */
$rsSections = CIBlockSection::GetList(array(),array('IBLOCK_ID' => $arParams ['IBLOCK_ID'], '=CODE' => $arResult['VARIABLES']['SECTION_CODE']));
$arSection = $rsSections->Fetch();
Answer the question
In order to leave comments, you need to log in
I see a complex component of the catalog there, you can get this value $arResult['VARIABLES']['SECTION_CODE'] in the template files of the complex component.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question