Skip to content

Instantly share code, notes, and snippets.

@steepzero-old
Created November 20, 2017 08:36
Show Gist options
  • Save steepzero-old/29cb5e7a88eda670f5bc5ad4b80acf53 to your computer and use it in GitHub Desktop.
Save steepzero-old/29cb5e7a88eda670f5bc5ad4b80acf53 to your computer and use it in GitHub Desktop.
protected static function getShipmentsInfo(Order $order)
{
$result = array();
$shipments = $order->getShipmentCollection();
/** @var \Bitrix\Sale\Shipment $shipment */
foreach($shipments as $shipment)
{
if($shipment->isSystem())
continue;
/** @var \Bitrix\Sale\Delivery\Services\Base $deliveryService */
$deliveryService = $shipment->getDelivery();
if(!$deliveryService)
continue;
$result[] = array(
"ID" => $shipment->getId(),
"NAME" => $deliveryService->getName(),
"LOGOTIP_PATH" => $deliveryService->getLogotipPath(),
"IS_SHIPPED" => $shipment->isShipped(),
"DEDUCTED" => $shipment->getField('DEDUCTED')
);
}
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment