Z
Z
zekin3752020-11-10 12:38:53
1C-Bitrix
zekin375, 2020-11-10 12:38:53

How to get images from several elements by ID?

Knowing the id of several products is required to get links to images from the MORE_PHOTO property I

figured out one product, but I don’t understand how to fill the array if there are several products

$iblock = 4;
$ielement = 354;
$arFilter = Array("IBLOCK_ID"=>$iblock, "ID"=>$ielement);
$res = CIBlockElement::GetList(Array(), $arFilter);
if ($ob = $res->GetNextElement()){;

    $arProps = $ob->GetProperties();

   }
foreach($arProps[MORE_PHOTO][VALUE] as $iFileID) {
   $arrFile[] = CFile::GetPath($iFileID);
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question