E
E
Evgeny Nikolaev2019-06-26 14:07:59
1C-Bitrix
Evgeny Nikolaev, 2019-06-26 14:07:59

How to filter by properties of trade offers in bitrix catalog.section?

The smart filter has been slightly edited, so a separate file has been created for ajax requests and the component output catalog.sectionto which the variable name is passed $arrFilter.
The values ​​of this array are formed from the data from the GET, as follows:

foreach ($_GET as $key => $get) :
    if (is_array($get)) {
      foreach ($get as $value) {
        $arrFilter['PROPERTY_'.$key.'_VALUE'][] = $value;
      }
    }
  endforeach;

If you create a property for goods, for example, then everything works fine SIZEwith the key and the goods are filtered. $arrFilter['PROPERTY_'.$key.'_VALUE']I found in the documentation that filtering by trade offers is carried out in exactly the same way, that is, for example , PROPERTY_SIZEor is indicated PROPERTY_SIZE_VALUE, but it doesn’t work either way. How to filter by a trade offer property with the name SIZE? Is it a problem with name conflicts? SIZEnow both goods and TP have it, while it is filtered by goods but not by TP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Nikolaev, 2019-06-26
@nikolaevevge

The answer was given on the Bitrix forum in this thread - https://dev.1c-bitrix.ru/support/forum/forum6/topi...
foreach ($_GET as $key => $get) :
if (is_array ($get)) {
foreach ($get as $value) {
}
}
endforeach;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question