Documentation

getCollectionsByProduct

array|null public
\Bitrix\Sale\Discount\Gift\Manager::getCollectionsByProduct(
 \Bitrix\Sale\Basket $basket,
 array $product
);

Method returns list of gift collections for product in shopping cart. Non-static method.

When shopping cart is empty, gifts without product are calculated first. Then, after product is added to shopping cart, gifts are calculated and comparison with previous sets of gifts is performed. When a difference is found as the result of comparison, the method returns an array with gifts to the product. Otherwise, returns an empty array.

Parameters

ParameterDescriptionVersion
$basketShopping cart.
$productArray with product parameters.

Example



© «Bitrix24», 2001-2024
Up