Answer the question
In order to leave comments, you need to log in
How to search for infoblock elements in Bitrix using the “or” rule?
How to form the $arFilter array in the method:
CIBlockElement::GetList($arSort, $arFilter, false, $arNavParams, $arSelect);
$arFilter = array(
'NAME' => '%' . $text . '%',
'DETAIL_TEXT' => '%' . $text . '%'
);
Answer the question
In order to leave comments, you need to log in
The arFilter parameter can contain nested filters. The nested filter array key must be a number. For example:$arFilter = array("NAME" => "A%", array(..<здесь пары "поле" => "фильтр">...), "IBLOCK_ID" => $IBLOCK_ID);
The nesting of filters is theoretically unlimited.
Also, filter conditions can be combined not only by the "AND" condition, but also by "OR". To do this, specify "LOGIC" as the filtered field. It can take two values: "AND" and "OR". The default is "AND". For example, let's choose small ripe and large unripe oranges:$arFilter = array( "IBLOCK_ID" => $IBLOCK_ID, "SECTION_CODE" => "orange", "INCLUDE_SUBSECTIONS" => "Y", array( "LOGIC" => "OR", array("<PROPERTY_RADIUS" => 50, "=PROPERTY_CONDITION" => "Y"), array(">=PROPERTY_RADIUS" => 50, "!=PROPERTY_CONDITION" => "Y"), ), );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question