T
T
tgarl2019-12-20 10:06:15
1C-Bitrix
tgarl, 2019-12-20 10:06:15

How can getlist get all elements except + excluding?

I have 2 properties: network and brand.
It is necessary to get all elements of the infoblock that do not belong to several networks, excluding 2 brands.
Those. If the element belongs to the network 1 or 2 - exclude, but if it is an element of brand A or B, then it cannot be excluded
What I thought of, but does not work

$GLOBALS[$arParams['FILTER_NAME']][]=[
        "LOGIC"=>"OR",
        [
            ['PROPERTY_195'=>[1747], 'PROPERTY_362'=>[1753,1754]], //элементы принадлежат сетям, но относятся к бренду
            ['!PROPERTY_362'=>[1753,1754]], // или все элементы не принадлежащие сетям
        ]
    ];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
tgarl, 2019-12-20
@tgarl

I found the reason, the error writing the filter is an extra nesting in the array,
the correct option is:

$GLOBALS[$arParams['FILTER_NAME']][]=[
        "LOGIC"=>"OR",
        
            ['PROPERTY_195'=>[1747], 'PROPERTY_362'=>[1753,1754]], //элементы принадлежат сетям, но относятся к бренду
            ['!PROPERTY_362'=>[1753,1754]], // или все элементы не принадлежащие сетям
     
    ];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question