A
A
Anton2019-05-07 21:24:04
1C-Bitrix
Anton, 2019-05-07 21:24:04

How to make a complex filter by properties?

Gathered this array:
print_r ($arrFilterS3);

Array ( [0] => Array ( [PROPERTY_GENDER] => 1981 ) [1] => Array ( [PROPERTY_MATERIAL] => 1988 ) )

I need to apply a filter in bitrix:catalog.section:
so that if there are two properties in the array, then the element that contains both properties at the same time is displayed and nothing else is displayed.
No matter how much I tried, it still displays elements that contain both the first and second property by separation.
Did through
"LOGIC" => "AND",
, but it is useless, or not correctly applied.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
unsweet, 2019-05-08
@unsweet

Just try

$arrFilterS3 = [
    ["LOGIC" => "AND",
    ["=PROPERTY_GENDER" => "1981"],
    ["=PROPERTY_MATERIAL" => "1988"],
  ],
];

and insert the filter name into the bitrix:catalog.section
"FILTER_NAME" => "arrFilterS3" component call,

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question