Answer the question
In order to leave comments, you need to log in
How to get infoblock element properties?
I output the infoblock and its elements like this. Elements have additional properties, how to get them in this code?
$arOrder = Array("SORT"=>"ASC");
$arFilter = Array(
"IBLOCK_SECTION_ID" => $arResult["ID"],
"SORT_BY1" => $arParams["SORT_BY1"],
"SORT_ORDER1" => $arParams["SORT_ORDER1"],
"SORT_BY2" => $arParams["SORT_BY2"],
"SORT_ORDER2" => $arParams["SORT_ORDER2"],
'GLOBAL_ACTIVE'=>'Y',
);
$obElement = CIBlockElement::GetList($arOrder, $arFilter, false, false, Array());
while($ar_fields = $obElement->GetNext())
{
var_dump($ar_fields['NAME']);
}
Answer the question
In order to leave comments, you need to log in
see the fifth parameter in CIBlockElement::GetList() in the documentation for examples.
remarks:
$arFilter = Array(
"ID" => УКАЖИ,
"IBLOCK_ID"=>УКАЖИ,
"IBLOCK_SECTION_ID" => $arResult["ID"],
);
$arSelect = Array("ID", "IBLOCK_ID", "NAME", "DATE_ACTIVE_FROM","PROPERTY_CODE");
$res = CIBlockElement::GetList(Array("SORT"=>"ASC"), $arFilter, false, Array("nPageSize"=>50), $arSelect);
while($ob = $res->GetNextElement()){
$arFields = $ob->GetFields();
print_r($arFields);
$arProps = $ob->GetProperties();
print_r($arProps);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question