Skip to content

Instantly share code, notes, and snippets.

@evgv
Last active July 17, 2018 19:50
Show Gist options
  • Save evgv/9b00d06697b864a3057b27d44de51718 to your computer and use it in GitHub Desktop.
Save evgv/9b00d06697b864a3057b27d44de51718 to your computer and use it in GitHub Desktop.
Magento. Get order shipment information.

Get order shipment information

Orders in Magento doesn't have a shipping date. They have shipments, and each one of them have a creation date.

You can access an order shipments using

$order->getShipmentsCollection();

Then on a shipment you can call getCreatedAt() to retreive creation date.

Thus, the full code will be

/** @var $order Mage_Sales_Model_Order */
foreach($order->getShipmentsCollection() as $shipment){
    /** @var $shipment Mage_Sales_Model_Order_Shipment */
    echo $shipment->getCreatedAt();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment