Want to add tracking information to an existing Magento shipment? Here is the code you can use:
1 2 3 4 5 6 7 8 9 |
$shipment = $order->getShipmentsCollection()->getFirstItem(); $trackingNumber = '12345678'; $track = Mage::getModel('sales/order_shipment_track') ->setShipment($shipment) ->setData('title', 'title') ->setData('number', $trackingNumber) ->setData('carrier_code', 'carrier code') ->setData('order_id', $shipment->getData('order_id')) ->save(); |
Adding tracking information to shipment
You want or need help implementing this solution? Maybe you did not find what you were looking for? Contact me and I will assist you with whatever Magento problem troubles you!