addProductToBasket
\Bitrix\Main\Result public static \Bitrix\Catalog\Product\Basket::addProductToBasket( \Bitrix\Sale\BasketBase $basket, array $fields, array $context );
Method adds product to an arbitrary shopping cart without checking access permission for current user. Static method.
Parameters
Parameter | Description | Version |
---|---|---|
$basket | Shopping cart object. | |
$fields | Array with added product parameters | |
$context | Array with content parameters (site, user). |
Exception
- \Bitrix\Main\LoaderException
- \Bitrix\Main\ObjectNotFoundException
Example
© «Bitrix24», 2001-2024