• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/services/automatic.php
  • Класс: BitrixSaleDeliveryServicesAutomatic
  • Вызов: Automatic::getMarginPrice
protected function getMarginPrice($price, $shipmentCurrency = '')
{
	if($this->config["MAIN"]["MARGIN_TYPE"] == "%")
	{
		$marginPrice = $price * floatval($this->config["MAIN"]["MARGIN_VALUE"]) / 100;
	}
	else
	{
		$marginPrice = floatval($this->config["MAIN"]["MARGIN_VALUE"]);

		if($marginPrice && $shipmentCurrency != '' && $this->currency != $shipmentCurrency)
		{
			if(Loader::includeModule('currency'))
			{
				$marginPrice = CCurrencyRates::convertCurrency(
					$marginPrice,
					$this->currency,
					$shipmentCurrency
				);
			}
		}
	}

	return $marginPrice;
}