• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/delivery/extra_services/enum.php
  • Класс: BitrixSaleDeliveryExtraServicesEnum
  • Вызов: Enum::getCost
public function getCost()
{
	if (
		!isset($this->params["PRICES"])
		|| !is_array($this->params["PRICES"])
	)
	{
		throw new SystemException("Service id: " . $this->id . " doesn't have field array PRICES");
	}

	if (isset($this->params["PRICES"][$this->value]["PRICE"]))
	{
		$result = $this->params["PRICES"][$this->value]["PRICE"];
	}
	else
	{
		$row = reset($this->params["PRICES"]);
		$result =$row["PRICE"] ?? 0;
	}

	return $this->convertToOperatingCurrency($result);
}