1

How to get tracking information from order shipment in magento 2?

  • what you want to get from tracking info ? – Rohan Hapani Oct 24 '18 at 11:49
  • All tracking info – Jitendra Patel Oct 24 '18 at 11:51
  • take a look at vendor/magento/module-sales/view/frontend/email/shipment_new.html – Marcel H. Oct 24 '18 at 11:52
  • Please check my answer. – Rohan Hapani Oct 24 '18 at 11:53
  • Is it working ? @JitendraPatel – Rohan Hapani Oct 25 '18 at 8:58
3

You can get all tracking details using this code :

$tracksCollection = $order->getTracksCollection();

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

     echo $track->getTrackNumber(); // Tracking number
     // You can get other details here.

}

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.