M
M
Maxim Tkachev2022-04-20 17:09:40
1C-Bitrix
Maxim Tkachev, 2022-04-20 17:09:40

How to exclude elements from the selection?

there is a category in products - hidden_section
how to exclude products that are in this section and in hidden_section when selecting a catalog section

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2022-04-20
@Real_Farmer

When selecting, use the LOGIC => AND construct in the filter, where you specify sections by ID or by LEFT_MARGIN / RIGHT_MARGIN with negation, or in the same filter specify an array of section IDs with negation. Can you provide code that you are unable to select?
Example with LOGIC => OR

$arrFilter[] = [
   "ACTIVE" => "Y",
   "LOGIC" => "OR",
   ["!SECTION_ID" => 345],
   ["!SECTION_ID" => 432]
 ];

Related documentation:
getList() D7
CIBlockElement::GetList() old core

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question