A
A
alexwprof2019-08-10 11:34:48
1C-Bitrix
alexwprof, 2019-08-10 11:34:48

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);


}
?>

In the code, we get the properties of the PROPERTIES infoblock - everything is added to the array just fine.
Apart from that, more data is needed. For example, a directory has an array ["PRICES"]. How to get other array values ​​or maybe the entire array at once?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2019-08-10
@alexwprof

CIBlockElement::GetList()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question