• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/internals/orderdiscount.php
  • Класс: BitrixSaleInternalsOrderDiscountTable
  • Вызов: OrderDiscountTable::calculateRuleHash
static function calculateRuleHash($discount)
{
	$hash = false;
	if (!empty($discount) && is_array($discount))
	{
		if (isset($discount['CONDITIONS_LIST']))
			$discount['CONDITIONS'] = $discount['CONDITIONS_LIST'];
		if (isset($discount['ACTIONS_LIST']))
			$discount['ACTIONS'] = $discount['ACTIONS_LIST'];
		if (!isset($discount['CONDITIONS']) || !isset($discount['ACTIONS']))
			return $hash;
		$fields = array(
			'CONDITIONS' => $discount['CONDITIONS'],
			'ACTIONS' => $discount['ACTIONS']
		);
		$hash = md5(serialize($fields));
	}
	return $hash;
}