Documentation

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

ParameterDescriptionVersion
$productArray with product parameters (jointly with properties).
$basketFieldsArray with shopping cart parameters (if used).
$optionsArray with additional parameters.

Exception

Example



© «Bitrix24», 2001-2024