• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/grid/panel/ui/item/editactionsitem.php
  • Класс: BitrixCatalogGridPanelUIItemEditActionsItem
  • Вызов: EditActionsItem::splitProductFields
private function splitProductFields(array $fields): array
{
	$elementFields = [];
	$productFields = [];
	$priceFields = [];

	$priceColumns = $this->getPriceColumns();
	$productColumns = $this->getProductColumns();

	foreach ($fields as $name => $value)
	{
		if (isset($productColumns[$name]))
		{
			if ($name === 'PURCHASING_PRICE')
			{
				if (is_array($value))
				{
					if (isset($value['PRICE']['VALUE']))
					{
						$productFields['PURCHASING_PRICE'] =
							$value['PRICE']['VALUE'] === ''
								? null
								: $value['PRICE']['VALUE']
						;
						$productFields['PURCHASING_CURRENCY'] = $value['CURRENCY']['VALUE'] ?? null;
					}
				}
				elseif ($value !== '')
				{
					$productFields[$name] = (float)$value;
				}
			}
			else
			{
				$productFields[$name] = $value;
			}
		}
		elseif (isset($priceColumns[$name]))
		{
			$priceTypeId = PriceProvider::parsePriceTypeId($name);
			if (isset($priceTypeId))
			{
				$priceFields[$priceTypeId] = [
					'PRICE' => $value['PRICE']['VALUE'] ?? null,
					'CURRENCY' => $value['CURRENCY']['VALUE'] ?? null,
				];
			}
		}
		else
		{
			$elementFields[$name] = $value;
		}
	}

	return [$elementFields, $productFields, $priceFields];
}