Skip to content

Instantly share code, notes, and snippets.

@web-masterok
Last active April 30, 2021 14:58
<?
\Bitrix\Main\Loader::includeModule('sale');
$arBasketItem = Bitrix\Sale\Internals\BasketTable::getList([
'filter' => [
'FUSER_ID' => Bitrix\Sale\Fuser::getId(), // ID покупателя, это может быть неавторизованный пользователь
'ORDER_ID' => null, // если заказ создан, передаем id заказа
'PRODUCT_ID' => $id, // id товара или предложения
'LID' => Bitrix\Main\Context::getCurrent()->getSite(), // работает только из публички, в другом случае можно указать жестко "s1"
'CAN_BUY' => 'Y',
],
'select' => [
'ID',
'PRODUCT_ID',
'QUANTITY',
],
])->fetch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment