Answer the question
In order to leave comments, you need to log in
How to filter items by SKU in Bitrix?
There is an array of articles.
"128806", "145267", "103748", "124208", "128804", "128805", "147683", "124201", "125533", "128801", "115858", "133042"
$amount = \Bitrix\Catalog\StoreProductTable::getList([
'filter' => [
'PRODUCT_ID' => $request['offerId']
]
])->fetchAll();
Answer the question
In order to leave comments, you need to log in
use Bitrix\Iblock\ElementPropertyTable;
use Bitrix\Main\ORM\Fields\Relations\Reference;
use Bitrix\Main\ORM\Query\Join;
\Bitrix\Main\Loader::includeModule('catalog');
$propertyId = 20;
$propertyValue = ['188-12-07'];
$result = \Bitrix\Catalog\StoreProductTable::getList([
'filter' => [
'ELEMENT_PROPERTIES.IBLOCK_PROPERTY_ID' => $propertyId,
'ELEMENT_PROPERTIES.VALUE' => $propertyValue,
],
'runtime' => [
new Reference('ELEMENT_PROPERTIES', ElementPropertyTable::class, Join::on('this.PRODUCT_ID', 'ref.IBLOCK_ELEMENT_ID'))
]
])->fetchAll();
print_r($result);
'ELEMENT_PROPERTIES.IBLOCK_PROPERTY_ID' => $propertyId,
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question