• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/skutree.php
  • Класс: BitrixCatalogComponentSkuTree
  • Вызов: SkuTree::getTemplatePropCell
protected function getTemplatePropCell($code, $offer, &$matrixFields, $skuPropList): array
{
	$cell = [
		'VALUE' => 0,
		'SORT' => PHP_INT_MAX,
		'NA' => true,
	];

	$skuPropSort = array_column($skuPropList[$code]['VALUES'], 'SORT', 'ID');

	if (isset($offer['DISPLAY_PROPERTIES'][$code]))
	{
		$matrixFields[$code] = true;
		$cell['NA'] = false;

		if ($skuPropList[$code]['USER_TYPE'] === 'directory')
		{
			$intValue = $skuPropList[$code]['XML_MAP'][$offer['DISPLAY_PROPERTIES'][$code]['VALUE']] ?? 0;
			$cell['VALUE'] = $intValue;
		}
		elseif ($skuPropList[$code]['PROPERTY_TYPE'] === 'L')
		{
			$cell['VALUE'] = (int)$offer['DISPLAY_PROPERTIES'][$code]['VALUE_ENUM_ID'];
		}
		elseif ($skuPropList[$code]['PROPERTY_TYPE'] === 'E')
		{
			$cell['VALUE'] = (int)$offer['DISPLAY_PROPERTIES'][$code]['VALUE'];
		}

		$cell['SORT'] = $skuPropSort[$cell['VALUE']];
	}

	return $cell;
}