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
Parameter | Description | Version |
---|---|---|
$basket | Shopping cart. | |
$product | Array with product parameters. |
Example
© «Bitrix24», 2001-2024