/basket_example_2.php Secret
Last active
April 30, 2021 14:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
\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