• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/controller/action/entity/order.php
  • Класс: BitrixSaleHelpersControllerActionEntityOrder
  • Вызов: Order::getVariants
static function getVariants(SaleOrder $order): array
{
	$propertyCollection = $order->getPropertyCollection();
	if (!$propertyCollection)
	{
		return [];
	}

	$propertyCollectionData = $propertyCollection->getArray();
	$propertyEnumIds = [];
	foreach ($propertyCollectionData['properties'] as $property)
	{
		if ($property['TYPE'] === 'ENUM')
		{
			$propertyEnumIds[] = $property['ID'];
		}
	}

	if (empty($propertyEnumIds))
	{
		return [];
	}

	$variants = SaleInternalsOrderPropsVariantTable::getList([
		'filter' => [
			'=ORDER_PROPS_ID' => $propertyEnumIds,
		],
		'order' => ['SORT' => 'ASC'],
	])->fetchAll();

	return $variants;
}