• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/gift/manager.php
  • Класс: BitrixSaleDiscountGiftManager
  • Вызов: Manager::isGift
public function isGift(Basket $basket, array $product)
{
	$this->errorCollection->clear();

	if(!$this->existsDiscountsWithGift())
	{
		return false;
	}

	if(!$this->isValidProduct($product))
	{
		return null;
	}

	if(!$this->checkProductInBasket($product, $basket))
	{
		$basket = $this->getBasketCopy($basket);
		$this->addProductToBasket($basket, $product);
	}
	list(, $appliedDiscounts) = $this->getDiscounts($basket);

	return $this->existProductInAppliedDiscounts($product, $appliedDiscounts);
}