• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/order/productmanager.php
  • Класс: Bitrix\Crm\Order\ProductManager
  • Вызов: ProductManager::getShippableProductList
protected function getShippableProductList(): array
{
	$products = [];

	if ($this->order)
	{
		$shipmentCollection = $this->order->getShipmentCollection()->getNotSystemItems();
		foreach ($shipmentCollection as $shipment)
		{
			/** @var ShipmentItem $shipmentItem */
			foreach ($shipment->getShipmentItemCollection() as $shipmentItem)
			{
				/** @var BasketItem $basketItem */
				$basketItem = $shipmentItem->getBasketItem();

				if (isset($products[$basketItem->getId()]))
				{
					$products[$basketItem->getId()]['QUANTITY'] += $shipmentItem->getQuantity();
				}
				else
				{
					$item = $this->extractDataFromBasketItem($basketItem);
					$item['QUANTITY'] = $shipmentItem->getQuantity();

					$products[$basketItem->getId()] = $item;
				}
			}
		}
	}

	return array_values($products);
}