2

How can I get the shipment tracking information from shipment or order object in magento2. Following ways doesn't work for me.

$shipment->getTrackingInfo();

$order->getTrackingInfoByOrder();
4

To get the shipping tracking numbers, use the following code.

$tracksCollection = $order->getTracksCollection();

foreach ($tracksCollection->getItems() as $track) {

     $trackNumbers[] = $track->getTrackNumber();

}

This will return an array of all shipment tracking numbers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.