1

I've created partially shipment functionality in magento2 now the problem is when i send the shipment email i got the every shipment traking id for that particular order but i want that particular shipment tracking id. but i dont know how can i do that. any help would be appreciate here i attach the code for the shipment email.

enter image description here

and here i attach the shipment email image

https://prnt.sc/15gm2fx

1 Answer 1

0

I suggest you try

$shipment = $objectManager->create('Magento\Sale\Mode\Order\Shipment')->load($shipmentId);
$tracksCollection = $shipment->getTracksCollection();
            foreach ($tracksCollection->getItems() as $track) {
                $trackNumber = $track->getTrackNumber();
                $carrierName = $track->getTitle();
            }
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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