• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/gridvariationform.php
  • Класс: BitrixCatalogComponentGridVariationForm
  • Вызов: GridVariationForm::getMoneyFieldValue
protected function getMoneyFieldValue(array $field)
{
	if ($field['priceTypeId'] === 'PURCHASING_PRICE')
	{
		$price = $this->entity->getField('PURCHASING_PRICE');
		$currency = $this->entity->getField('PURCHASING_CURRENCY');
	}
	else
	{
		$priceItem = $this->entity
			->getPriceCollection()
			->findByGroupId($field['priceTypeId'])
		;
		$price = $priceItem ? $priceItem->getPrice() : null;
		$currency = $priceItem ? $priceItem->getCurrency() : null;
	}

	$currency = $currency ?? CurrencyManager::getBaseCurrency();

	return CCurrencyLang::CurrencyFormat($price, $currency, true);
}