addProduct
\Bitrix\Main\Result public static \Bitrix\Catalog\Product\Basket::addProduct( array $product, array $basketFields = array(), array $options = array() );
Method adds a product into a current user's shopping cart (not an order) at the site. Developed for public components as replacement for the function Add2BasketByProductID
. Static method.
Parameters
Parameter | Description | Version |
---|---|---|
$product | Array with product parameters (jointly with properties). | |
$basketFields | Array with shopping cart parameters (if used). | |
$options | Array with additional parameters. |
Exception
- \Bitrix\Main\LoaderException
- \Bitrix\Main\ObjectNotFoundException
Example
© «Bitrix24», 2001-2024