• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount/analyzer.php
  • Класс: BitrixSaleDiscountAnalyzer
  • Вызов: Analyzer::isContainGiftAction
public function isContainGiftAction(array $discount)
{
	if(isset($discount['ACTIONS']) && is_string($discount['ACTIONS']))
	{
		return mb_strpos($discount['ACTIONS'], CSaleActionGiftCtrlGroup::getControlID()) !== false;
	}
	elseif(isset($discount['ACTIONS_LIST']['CHILDREN']) && is_array($discount['ACTIONS_LIST']['CHILDREN']))
	{
		foreach($discount['ACTIONS_LIST']['CHILDREN'] as $child)
		{
			if(
				isset($child['CLASS_ID']) && isset($child['DATA']) &&
				$child['CLASS_ID'] === CSaleActionGiftCtrlGroup::getControlID()
			)
			{
				return true;
			}
		}
		unset($child);
	}

	return false;
}