Answer the question
In order to leave comments, you need to log in
How to get property values with the same character code from several infoblocks at the same time?
There are several infoblocks of the same type, all of them have properties with the symbolic code PRICE_M2, the data type is a number. I get elements from these infoblocks as follows:
$filter = [
'IBLOCK_TYPE' => $this->arParams['IBLOCK_TYPE'],
'IBLOCK_ID' => $iblocksIds //массив идентификаторов инфоблоков
];
$resultRaw = CIBlockElement::getList(
['sort' => 'asc'],
$filter,
false, false,
[
'ID', 'IBLOCK_ID', 'NAME',
'DETAIL_PICTURE', 'DETAIL_PAGE_URL',
'PROPERTY_PRICE_M2'
]
);
Answer the question
In order to leave comments, you need to log in
In the filter, you can check if the infoblock element has a value, if you, of course, need only elements with a filled property.
Get by CODE I suggest the following construction
while ($obElement = $resultRaw->GetNextElement()) {
$arProperties = $obElement->GetProperties(false, ['CODE' => 'PRICE_M2']);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question