StartResultCache(60*60*24, md5(var_export($_POST, true)))) { if(CModule::IncludeModule('iblock')) { $arResult = []; $sort = Array("SORT" => "ASC", "NAME" => "ASC"); $filter = Array("ACTIVE" => "Y", "IBLOCK_ID" => 4); $options = Array("nPageSize" => 1000); if(!empty($_REQUEST['brand'])) { $filter['PROPERTY_BRAND.CODE'] = $_REQUEST['brand']; } $res = CIBlockElement::GetList($sort, $filter, false, $options); $arResult = [ 'ITEMS' => [], //'BRANDS' => [], ]; while ($obElement = $res->GetNextElement()) { $ar_res = $obElement->GetFields(); $ar_res['PROPERTIES'] = $obElement->GetProperties(); /* $ar_res['PROPERTIES']['BRAND']['RELATED'] = get_related_array(8, $ar_res['PROPERTIES']['BRAND']['VALUE']); foreach($ar_res['PROPERTIES']['BRAND']['RELATED'] AS $b) { $arResult['BRANDS'][$b['NAME']] = $b['ID']; } */ if(isset($ar_res['PREVIEW_PICTURE'])) { $ar_res['PREVIEW_PICTURE'] = CFile::GetPath($ar_res['PREVIEW_PICTURE']); } if(isset($ar_res['DETAIL_PICTURE'])) { $ar_res['DETAIL_PICTURE'] = CFile::GetPath($ar_res['DETAIL_PICTURE']); } $arResult['ITEMS'][] = $ar_res; } //ksort($arResult['BRANDS']); if($arParams["PAGINATION"] == "Y") { $arResult["NAV_STRING"] = $res->GetPageNavStringEx( $navComponentObject, "", "catalog", "N" ); } $this->IncludeComponentTemplate(); } }