• Модуль: catalog
  • Путь к файлу: ~/bitrix/modules/catalog/lib/component/skutree.php
  • Класс: BitrixCatalogComponentSkuTree
  • Вызов: SkuTree::prepareOfferTreeProperties
private function prepareOfferTreeProperties(array $offers): array
{
	if (empty($offers))
	{
		return [];
	}

	$products = [];

	foreach ($offers as &$offer)
	{
		foreach ($this->getPropertyCodes() as $code)
		{
			if (!isset($offer['PROPERTIES'][$code]))
				continue;

			$prop = &$offer['PROPERTIES'][$code];
			$boolArr = is_array($prop['VALUE']);
			if (
				($boolArr && !empty($prop['VALUE']))
				|| (!$boolArr && (string)$prop['VALUE'] !== '')
			)
			{
				$offer['DISPLAY_PROPERTIES'][$code] = CIBlockFormatProperties::GetDisplayValue($offer, $prop);
			}
		}

		$products[$offer['PARENT_PRODUCT_ID']]['OFFERS'][] = $offer;
	}
	unset($offer);

	return $products;
}