• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/helpers/admin/blocks/ordershipment.php
  • Класс: BitrixSaleHelpersAdminBlocksOrderShipment
  • Вызов: OrderShipment::getDeliveryServiceList
static function getDeliveryServiceList($shipment = null)
{
	static $result = null;
	$logoPath ='/bitrix/images/sale/logo-default-d.gif';

	if($result === null)
	{
		if ($shipment != null)
			self::$shipment = $shipment;

		$result = array(
			array(
				'ID' => 0,
				'PARENT_ID' => 0,
				'NAME' => Loc::getMessage('SALE_ORDER_PAYMENT_NO_DELIVERY_SERVICE'),
				'LOGOTIP' => array(
					'MAIN' => $logoPath,
					'SHORT' =>  $logoPath
				)
			)
		);

		$deliveryList = ServicesManager::getRestrictedList(
			self::$shipment,
			RestrictionsManager::MODE_MANAGER,
			array(
				ServicesManager::SKIP_CHILDREN_PARENT_CHECK,
				ServicesManager::SKIP_PROFILE_PARENT_CHECK
			)
		);

		foreach ($deliveryList as $delivery)
		{
			$service = ServicesManager::getObjectById($delivery['ID']);

			if(!$service)
				continue;

			if($shipment && !$service->isCompatible($shipment))
				continue;

			if ($service->canHasProfiles())
			{
				$profiles = $service->getProfilesList();
				if (empty($profiles))
					continue;
			}

			$logo = $service->getLogotip();

			if (!empty($logo))
			{
				$mainLogo = self::getMainImgPath($logo);
				$shortLogo = self::getShortImgPath($logo);
				$delivery['LOGOTIP'] = array(
					'MAIN' => $mainLogo['src'],
					'SHORT' =>  $shortLogo['src']
				);
			}
			else
			{
				$delivery['LOGOTIP'] = array(
					'MAIN' => $logoPath,
					'SHORT' =>  $logoPath
				);
			}
			$result[$delivery['ID']] = $delivery;
		}
	}

	return $result;
}