<?
if($section['RIGHT_MARGIN'] - $section['LEFT_MARGIN'] == 1) {
$APPLICATION->IncludeComponent(
"bitrix:catalog.smart.filter",
$template,
Array(
"IBLOCK_TYPE" => $arParams["IBLOCK_TYPE"],
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"AJAX_FILTER_FLAG" => $isAjaxFilter,
"SECTION_ID" => (isset($arSection["ID"]) ? $arSection["ID"] : ''),
"FILTER_NAME" => $arParams["FILTER_NAME"],
"PRICE_CODE" => ($arParams["USE_FILTER_PRICE"] == 'Y' ? $arParams["FILTER_PRICE_CODE"] : $arParams["PRICE_CODE"]),
"CACHE_TYPE" => $arParams["CACHE_TYPE"],
"CACHE_TIME" => $arParams["CACHE_TIME"],
"FILL_COMPACT_FILTER" => $arParams["FILL_COMPACT_FILTER"],
"CACHE_NOTES" => "",
"CACHE_GROUPS" => $arParams["CACHE_GROUPS"],
"SAVE_IN_SESSION" => "N",
"XML_EXPORT" => "Y",
"SECTION_TITLE" => "NAME",
"SECTION_DESCRIPTION" => "DESCRIPTION",
"SHOW_HINTS" => $arParams["SHOW_HINTS"],
'CONVERT_CURRENCY' => $arParams['CONVERT_CURRENCY'],
'CURRENCY_ID' => $arParams['CURRENCY_ID'],
'DISPLAY_ELEMENT_COUNT' => $arParams['DISPLAY_ELEMENT_COUNT'],
"INSTANT_RELOAD" => "Y",
"VIEW_MODE" => strtolower($arTheme["FILTER_VIEW"]["VALUE"]),
"SEF_MODE" => (strlen($arResult["URL_TEMPLATES"]["smart_filter"]) ? "Y" : "N"),
"SEF_RULE" => $arResult["FOLDER"].$arResult["URL_TEMPLATES"]["smart_filter"],
"SMART_FILTER_PATH" => $arResult["VARIABLES"]["SMART_FILTER_PATH"],
"HIDE_NOT_AVAILABLE" => $arParams["HIDE_NOT_AVAILABLE"],
"SORT_BUTTONS" => $arParams["SORT_BUTTONS"],
"SORT_PRICES" => $arParams["SORT_PRICES"],
"AVAILABLE_SORT" => $arAvailableSort,
"SORT" => $sort,
"SORT_ORDER" => $sort_order,
),
$component);
}
?>
if($section['RIGHT_MARGIN'] - $section['LEFT_MARGIN'] == 1) {
// компонент фильтра
}
$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('sender', 'OnBeforePostingSendRecipient', ['SenderEvents', 'OnBeforePostingSendRecipient']);
class SenderEvents {
public static function OnBeforePostingSendRecipient($event) {
$parameters = $event->getParameters();
return new \Bitrix\Main\EventResult(\Bitrix\Main\EventResult::SUCCESS, $parameters);
}
}
echo '<pre> $arResult<br>';
print_r($arResult['VARIABLES']);
echo '</pre>';
echo '<pre> $section <br>';
print_r($section);
echo '</pre>';
if($section['RIGHT_MARGIN'] - $section['LEFT_MARGIN'] == 1)
$arCoupon = \Bitrix\Sale\Internals\DiscountCouponTable::getList()->fetchAll();
\Bitrix\Main\Loader::includeModule('iblock');
$iblockId = 2;
$sectionsId = $sections = $elements = [];
$page = 1;
$limit = 10;
$iterator = \CIBlockElement::GetList([], ['IBLOCK_ID' => $iblockId], ['IBLOCK_ID', 'IBLOCK_SECTION_ID', 'ID', 'CODE', 'NAME', 'DETAIL_PAGE_URL'], ['nPageSize' => $limit, 'iNumPage' => $page]);
while($row = $iterator->GetNext()) {
$sectionId = $row['IBLOCK_SECTION_ID'];
$sectionsId[] = $sectionId;
$elements[$sectionId][] = $row;
}
if($sectionsId) {
$sectionsId = array_unique($sectionsId);
$iterator = \CIBlockSection::GetList(['ID' => 'ASC'], ['IBLOCK_ID' => $iblockId, 'ID' => $sectionsId], false, ['ID', 'NAME', 'SECTION_PAGE_URL'], false);
while($row = $iterator->GetNext()) {
$sectionId = $row['ID'];
$sections[$sectionId] = $row;
$sections[$sectionId]['ITEMS'] = $elements[$sectionId];
}
}
echo '<pre>';
print_r($sections);
echo '</pre>';