• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/discount.php
  • Класс: BitrixSaleDiscount
  • Вызов: Discount::normalizeDiscountResult
protected function normalizeDiscountResult()
{
	parent::normalizeDiscountResult();

	if (empty($this->orderData))
	{
		return;
	}

	$customPrice = isset($this->orderData['CUSTOM_PRICE_DELIVERY']) && $this->orderData['CUSTOM_PRICE_DELIVERY'] == 'Y';
	$this->orderData['PRICE_DELIVERY_DIFF'] = (!$customPrice
		? PriceMaths::roundPrecision($this->orderData['PRICE_DELIVERY_DIFF'])
		: 0
	);
	if (!$customPrice)
	{
		if ($this->orderData['PRICE_DELIVERY_DIFF'] > 0)
			$this->orderData['PRICE_DELIVERY'] = $this->orderData['BASE_PRICE_DELIVERY'] - $this->orderData['PRICE_DELIVERY_DIFF'];
		else
			$this->orderData['PRICE_DELIVERY'] = PriceMaths::roundPrecision($this->orderData['PRICE_DELIVERY']);
	}
	unset($customPrice);
}