Documentation

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

ParameterDescriptionVersion
$basketShopping cart object.
$fieldsArray with added product parameters
$contextArray with content parameters (site, user).

Exception

Example



© «Bitrix24», 2001-2024
Up