• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/discount/discountmanager.php
  • Класс: BitrixCatalogDiscountDiscountManager
  • Вызов: DiscountManager::getRoundResult
static function getRoundResult(array $basketItem, array $roundData): array
{
	$result = [
		'ROUND_RULE' => $roundData
	];
	$result['PRICE'] = CatalogProductPrice::roundValue(
		$basketItem['PRICE'],
		$roundData['ROUND_PRECISION'],
		$roundData['ROUND_TYPE']
	);

	if (isset($basketItem['BASE_PRICE']))
	{
		$result['DISCOUNT_PRICE'] = $basketItem['BASE_PRICE'] - $result['PRICE'];
	}
	else
	{
		if (!isset($result['DISCOUNT_PRICE']))
			$result['DISCOUNT_PRICE'] = 0;
		$result['DISCOUNT_PRICE'] += ($basketItem['PRICE'] - $result['PRICE']);
	}

	return $result;
}