Verwenden Sie den folgenden Code, um ein Tracking zu einer bereits bestehenden Lieferung (Shipment) hinzuzufügen.
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(); |