Answer the question
In order to leave comments, you need to log in
How to add an array from another infoblock to $arResult in Bitrix?
There is an online store with goods. One of the pages needed data from the catalog component array. This array is not available at this location.
The result_modifier.php file contains the following code:
<?
if(CModule::IncludeModule("iblock"))
{
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "PREVIEW_PICTURE", "DETAIL_PAGE_URL",
"DATE_ACTIVE_FROM","PRICES", "GetProperties", "PROPERTY_*");
$arFilter = Array("IBLOCK_ID"=> 2, "DATA_ACTIVE_FROM" => "ASC", "ACTIVE" => "Y");
$res = CIBlockElement::GetList(Array(),
$arFilter,//ФИЛЬТР ДАННЫХ
false,//ГРУППИРОВКА ДАННЫХ
false,//ДЛЯ ПОСТРАНИЧНОЙ НАВИГАЦИИ
$arSelect);
while($ob = $res->GetNextElement()){
$arItem = $ob->GetFields();
$arItem["PROPERTIES"] = $ob->GetProperties();
$arResult[] = $arItem;
}
debug($arResult);
}
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question