Documentation

addProductToBasketWithPermissions

\Bitrix\Main\Result public static
\Bitrix\Catalog\Product\Basket::addProductToBasketWithPermissions(
 \Bitrix\Sale\BasketBase $basket,
 array $fields,
 array $context,
 boolean $useMerge = true
);

Method adds product into arbitrary shopping cart with access permission check for the current user. Static method.

Parameters

ParameterDescriptionVersion
$basketShopping cart object.
$fieldsArray with added product parameters.
$contextArray with content parameters (site, user).
$useMergeChecks existing entry in the shopping cart before adding a product.

Exception

Example



© «Bitrix24», 2001-2024
Up