K
K
Kirill Gorelov2022-01-23 15:58:47
1C-Bitrix
Kirill Gorelov, 2022-01-23 15:58:47

Bitrix, filtering products by the properties of trade offers?

Actually, the whole question .....
I rummaged through a bunch of documentation, articles and other things, there is no clear answer anywhere ....

I have a complex catalog.
I need to display products whose trade offers have a diameter = 50 (conditionally). Hide other trading offers and do not show them.
Tried like this - doesn't work:

$filters['OFFERS']['PROPERTY_'.$key] = explode(',', $value);


Tried that - nothing changes either. Yes, and he does not issue anything under the request.
$filters['ID'] = array(
                    CIBlockElement::SubQuery('CML2_LINK', array(
                        'IBLOCK_ID' => 5,
                        'PROPERTY_P_e294c8a1_8c76_11e6_af60_001e67496364'=>140,
                    ),
                )
                );


If I replace CML2_LINK with PROPERTY_CML2_LINK, then it gives an error Object of class CIBlockElement could not be converted to string . Transferred to a regular array, but without success, then nothing will be returned at all.
$filters['ID'] = array(
                    CIBlockElement::SubQuery('PROPERTY_CML2_LINK', array(
                        'IBLOCK_ID' => 5,
                        'PROPERTY_P_e294c8a1_8c76_11e6_af60_001e67496364'=>140,
                    ),
                )
                );

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Gorelov, 2022-01-24
@Kirill-Gorelov

Why is everything so complicated in this Bitrix ((((
I spent a couple or three days with this garbage.
Here the guy found the answer https://qna.habr.com/q/643225
I did the same, but nothing was filtered.... But after a
couple of days I decided to look at arResult and it turns out there is an array like this FILTERED_OFFERS_ID
And here it contains filtered trading properties.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question