<?$APPLICATION->IncludeComponent(
"bitrix:catalog.section.list",
"",
array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"COUNT_ELEMENTS" => "N",
"TOP_DEPTH" => $arParams["SECTION_TOP_DEPTH"],
"SECTION_URL" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["section"],
"VIEW_MODE" => $arParams["SECTIONS_VIEW_MODE"],
"SHOW_PARENT_NAME" => $arParams["SECTIONS_SHOW_PARENT_NAME"],
"HIDE_SECTION_NAME" => (isset($arParams["SECTIONS_HIDE_SECTION_NAME"]) ? $arParams["SECTIONS_HIDE_SECTION_NAME"] : "N"),
"ADD_SECTIONS_CHAIN" => (isset($arParams["ADD_SECTIONS_CHAIN"]) ? $arParams["ADD_SECTIONS_CHAIN"] : '')
),
$component
);
?>
"SEF_URL_TEMPLATES" => array("sections"=>"","section"=>"section/#SECTION_CODE#/","element"=>"kkm/#ELEMENT_CODE#/","compare"=>"compare/","smart_filter"=>"section/#SECTION_CODE_PATH#/filter/#SMART_FILTER_PATH#/apply/",)
"SEF_URL_TEMPLATES" => array(
"sections"=>"",
"section"=>"section/#SECTION_CODE#/",
"element"=>"kkm/#ELEMENT_CODE#/",
"compare"=>"compare/",
"smart_filter"=>"section/#SECTION_CODE_PATH#/filter/#SMART_FILTER_PATH#/apply/",
"question" => "kkm/#ELEMENT_CODE#/question/"
)
$arSelect = Array("ID", "IBLOCK_ID", "CREATED_BY", "DATE_CREATE", "ACTIVE", "PREVIEW_TEXT", "DETAIL_TEXT", "PROPERTY_USER_ID", "PROPERTY_GOOD_REVIEW", "PROPERTY_NAME", "PROPERTY_RATING", "PROPERTY_USER_PROD_IMG", "PROPERTY_RE_REVIEW");
$arFilter = Array("IBLOCK_ID" => $arParams["REVIEW_IBLOCK_ID"], "CODE" => $arResult["ID"]);
$res = CIBlockElement::GetList(Array("DATE_CREATE" => "DESC"), $arFilter, false, array('nTopCount' => 3), $arSelect);
$arResult['VARIABLES']
$arTemplateParameters['SEF_URL_TEMPLATES_question'] = array(
'PARENT' => 'SEF_MODE',
'NAME' => "Вопросы",
"DEFAULT" => "",
"VARIABLES" => array(),
);
$GLOBALS['questionFilter'] = ["CODE" => $arResult["ID"]];
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
die();?>
<?CModule::IncludeModule("iblock");
$dbE = CIBlockElement::GetList(Array(), Array('CODE' => $arResult["VARIABLES"]["ELEMENT_CODE"]), false, false, array("ID", "IBLOCK_SECTION_ID"));
if ($arE = $dbE->GetNext()) {
$elementID = $arE["ID"];
$iblockSectID = $arE["IBLOCK_SECTION_ID"];
}?>
<?$GLOBALS['questionFilter'] = ["CODE" => $elementID];?>
<?$APPLICATION->IncludeComponent(
"bitrix:news.list",
"reviews_2",
Array(
"FILTER_NAME" => $GLOBALS['questionFilter'],
"IBLOCK_TYPE" => "1c_catalog",
"IBLOCK_ID" => "61"
)
);?>
while ($arE = $dbE->GetNext()) {
$elementID[] = $arE["ID"];
$iblockSectID = $arE["IBLOCK_SECTION_ID"];
}
?>
<?$GLOBALS['questionFilter'] = ["ID" => $elementID];?>
$dbE = CIBlockElement::GetList(Array(), Array('CODE' => $arResult["VARIABLES"]["ELEMENT_CODE"]), .....
$dbE = CIBlockElement::GetList(Array(), Array('IBLOCK_ID' => 61, 'CODE' => $arResult["VARIABLES"]["ELEMENT_ID"]), false, false, array("ID", "IBLOCK_SECTION_ID"));
<?CModule::IncludeModule("iblock");
$dbE = CIBlockElement::GetList(Array(), Array('CODE' => $arResult["VARIABLES"]["ELEMENT_CODE"]), false, false, array("ID", "IBLOCK_SECTION_ID"));
while ($arE = $dbE->GetNext()) {
$elementID = $arE["ID"];
$iblockSectID = $arE["IBLOCK_SECTION_ID"];
}
?>
<?$GLOBALS['questionFilter'] = ["ID" => $elementID, "IBLOCK_ID" => "61"];?>
<pre><?print_r($elementID)?></pre>
<?$APPLICATION->IncludeComponent(
"bitrix:news.list",
"reviews_2",
Array(
"FILTER_NAME" => $GLOBALS['questionFilter'],
"IBLOCK_TYPE" => "1c_catalog"
)
);?>
<? if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true)
die();?>
//здесь ведь мы получаем ID товара и ID его раздела, по его символьному коду и уже ID товара передаем
в компонент news.list. Вот только в компоненте не выводятся вопросы.
<?CModule::IncludeModule("iblock");
$dbE = CIBlockElement::GetList(Array(), Array("IBLOCK_ID" => 61, 'CODE' => $arResult["VARIABLES"]["ELEMENT_CODE"]), false, false, array("ID", "IBLOCK_SECTION_ID"));
while ($arE = $dbE->GetNext()) {
$elementID[] = $arE["ID"];
$iblockSectID = $arE["IBLOCK_SECTION_ID"];
}
?>
<?$GLOBALS['questionFilter'] = ["ID" => $elementID];?>
<pre><?print_r($elementID)?></pre>
<?$APPLICATION->IncludeComponent(
"bitrix:news.list",
"reviews_2",
Array(
"FILTER_NAME" => $GLOBALS['questionFilter'],
"IBLOCK_TYPE" => "1c_catalog",
"IBLOCK_ID" => "61"
)
);?>
$id = CIBlockElement::GetList([], ["IBLOCK_ID" => $arParams["IBLOCK_ID"], 'CODE' => $arResult["VARIABLES"]['ELEMENT_CODE']], false, false, ['ID'])->Fetch();
$dbE = CIBlockElement::GetList(Array(), Array("IBLOCK_ID" => 61, 'CODE' => $id), false, false, array("ID", "IBLOCK_SECTION_ID"));
$dbE = CIBlockElement::GetList(Array(), Array('CODE' => $arResult["VARIABLES"]["ELEMENT_CODE"]), false, false, array("ID", "IBLOCK_SECTION_ID"));
while ($arE = $dbE->GetNext()) {
$elementID[] = $arE["ID"]; // здесь не нужен массив, так как товар один
$iblockSectID = $arE["IBLOCK_SECTION_ID"];
}
$GLOBALS['questionFilter'] = ["ID" => $elementID];
$APPLICATION->IncludeComponent(
"bitrix:news.list",
"reviews_2",
Array(
"FILTER_NAME" => $GLOBALS['questionFilter'],
"IBLOCK_TYPE" => "1c_catalog",
"IBLOCK_ID" => "61"
)
);
$GLOBALS['questionFilter'] = ["ID" => $elementID, "IBLOCK_SECTION_ID" => $iblockSectID];
$APPLICATION->IncludeComponent(
"bitrix:news.list",
"reviews_2",
Array(
"IBLOCK_TYPE" => "1c_catalog",
"IBLOCK_ID" => "61"
)
);
$iblockSectID = $GLOBALS['questionFilter']["IBLOCK_SECTION_ID"];
$elementID = $GLOBALS['questionFilter']["ID"];
$questionsId = [];
$questionIblockId = 61;
$catalogIblockId = $arParams["IBLOCK_ID"]; // 64
$elementCode = $arResult["VARIABLES"]['ELEMENT_CODE'];
// element
$element = CIBlockElement::GetList([], ["IBLOCK_ID" => $catalogIblockId, 'CODE' => $elementCode, false, false, ['ID', 'IBLOCK_SECTION_ID'])->Fetch();
// questions
$iterator = CIBlockElement::GetList(Array(), Array("IBLOCK_ID" => $questionIblockId, 'CODE' => $element['ID']), false, false, array("ID"));
while($row = $iterator->Fetch()) {
$questionsId[] = $row['ID'];
}
$GLOBALS['questionFilter'] = ["ID" => $questionsId];
$APPLICATION->IncludeComponent(
"bitrix:news.list",
"reviews_2",
Array(
"FILTER_NAME" => 'questionFilter',
"IBLOCK_TYPE" => "ЗДЕСЬ_ТИП_ИНФОБЛОКА_ВОПРОСОВ",
"IBLOCK_ID" => $questionIblockId
)
);
"SEF_URL_TEMPLATES" => array(
"sections"=>"",
"section"=>"section/#SECTION_CODE#/",
"element"=>"kkm/#ELEMENT_CODE#/",
"compare"=>"compare/",
"smart_filter"=>"section/#SECTION_CODE_PATH#/filter/#SMART_FILTER_PATH#/apply/",
"question" => "kkm/#ELEMENT_CODE#/question/"
)
array (
'CONDITION' => '#^/catalog/([0-9a-zA-Z_-]+)/question([\\?\\#].*)?$#',
'RULE' => 'ELEMENT_CODE=$1',
'ID' => '',
'PATH' => '/faq/detail.php',
'SORT' => 100,
),