C
C
caesar_882020-07-18 16:05:07
1C-Bitrix
caesar_88, 2020-07-18 16:05:07

How to filter ID WHERE IN ARRAY in CIBlockElement::GetList?

There is a self-written table.
I get an array of product IDs from there in the following way:
$subQuery = \Local\Core\Model\Data\ProductStockTable::getList(array( // Bitrix\Main\ORM\Query\Result
'select' => array('PRODUCT_ID') ,
'filter' => \Bitrix\Main\ORM\Query\Query::filter()
->where('AMOUNT', '>', 0)
));

Now we need to pass this array to the CATALOG complex component in advance, so that both the smart filter and all products are displayed taking into account the hit in this array.

That is, I have the values ​​​​of the balance of goods stored in a separate table. And I need to make the "In stock" filter in the standard Bitrix catalog. How to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2020-07-18
@gangstarcj

Just pass the filter to the component
https://dev.1c-bitrix.ru/learning/course/index.php...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question