How To Get Tracking Number From Order History In Magento.?

Get Tracking Number From Order History:-

Tracking number in magento are used for to track the orders number. You can get easily tracking number from magento by order_shipment_collection. Here we are going to explain how to get tracking number from magento order object.

$order = Mage::getModel('sales/order')->loadByIncrementId($order_id);
$shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')
            ->setOrderFilter($order)
        ->load();
        foreach ($shipmentCollection as $shipment){
            foreach($shipment->getAllTracks() as $tracknumber)
            {
                $trackingnumbers[]=$tracknumber->getNumber();
            }

        }

The above example will give tracking numbers.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *