V
V
VicTHOR2019-10-25 20:38:56
1C-Bitrix
VicTHOR, 2019-10-25 20:38:56

How to set a filter?

You need to filter only products of certain sections. These sections have up to 4 levels of nesting. The filter without SECTION_ID includes sections from other sections, but they have only 2 levels of nesting.
Those. i need or something

$cat = CIBlockSection::GetList(
    [],
  ["!SECTION_ID" => "1673|6044|6041|6022", "ELEMENT_SUBSECTIONS" => "N", "CNT_ACTIVE" => "Y"],
    true,
  ['ID', 'NAME', 'ELEMENT_CNT'],
  false
);
But in this case, only the check for 1673 works.
Or, specify SECTION_ID between two values ​​of the first level, while the results will be at levels 3-4.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
Georgy Baruchyan, 2019-10-26
@VicTHOR

Try ['@SECTION_ID' => [1673, 6044, 6041, 6022]]

A
Alex-1917, 2019-10-25
@alex-1917

The filter without SECTION_ID includes sections from other sections

And what??!!)) This is standard logic.
I didn’t understand anything further, some kind of nonsense, in the general case, if you need a selection by several SECTION_IDs, then like this:
Array
   ( 
      "LOGIC" => "OR",
      Array([SECTION_ID] => 111),
     Array([SECTION_ID] => 222),
   )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question