if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) die(); /** * @var CBitrixComponentTemplate $this * @var CatalogElementComponent $component */ $component = $this->getComponent(); $arParams = $component->applyTemplateModifications(); if(!(CModule::IncludeModule("iblock"))) { exit; } $arAddProps = array("SIZE");// массив кодов свойств инфоблока торговых предложений которые необходимы для вывода на карточке товара $arSelect = Array(); foreach ($arAddProps as $one) { $arSelect[] = "PROPERTY_$one"; } $arSort = array(); $arFilter = Array("IBLOCK_ID"=>2, "ACTIVE_DATE"=>"Y", "ACTIVE"=>"Y"); foreach ($arResult["OFFERS"] as $key => $one) { $arFilter["ID"] = $one["ID"]; $res = CIBlockElement::GetList($arSort, $arFilter, false, Array(), $arSelect); if ($ob = $res->GetNextElement()) { $arFields = $ob->GetFields(); foreach ($arAddProps as $oo) { if (isset($arFields[("PROPERTY_" . $oo . "_VALUE")])) { $arResult["OFFERS"][$key][("PROPERTY_" . $oo . "_VALUE")] = $arFields[("PROPERTY_" . $oo . "_VALUE")]; } if (isset($arFields[("PROPERTY_" . $oo . "_VALUE_ID")])) { $arResult["OFFERS"][$key][("PROPERTY_" . $oo . "_VALUE_ID")] = $arFields[("PROPERTY_" . $oo . "_VALUE_ID")]; } } } }