PurchasingPriceFieldAssembler::prepareRow

  1. Bitrix24 API (v. 23.675.0)
  2. catalog
  3. PurchasingPriceFieldAssembler
  4. prepareRow
  • Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/grid/row/assembler/purchasingpricefieldassembler.php
  • Класс: BitrixCatalogGridRowAssemblerPurchasingPriceFieldAssembler
  • Вызов: PurchasingPriceFieldAssembler::prepareRow
protected function prepareRow(array $row): array
{
	$priceValue = $row['data'][self::PRICE_COLUMN] ?? null;
	$currencyValue = $row['data'][self::CURRENCY_COLUMN] ?? null;

	if (Loader::includeModule('currency'))
	{
		$row['columns'][self::PRICE_COLUMN] = CCurrencyLang::CurrencyFormat(
			$priceValue,
			$currencyValue
		);
	}
	else
	{
		$row['columns'][self::PRICE_COLUMN] = $priceValue;
	}

	$row['data']['~' . self::PRICE_COLUMN] = [
		'PRICE' => [
			'NAME' => 'PRICE',
			'VALUE' => $priceValue,
		],
		'CURRENCY' => [
			'NAME' => 'CURRENCY',
			'VALUE' => $currencyValue,
		],
	];

	return $row;
}

Добавить комментарий