I like to add tracking ID link for my shipping email template form. Please advice me to do this process.


Please override this file:


by creating this path:


Please add below code in foreach loop

$trackurl = '';
if($_item->getCarrierCode() === 'fedex'){
    $trackurl = 'https://www.fedex.com/apps/fedextrack/?action=track&trackingnumber='.$_item->getNumber();
}elseif ($_item->getCarrierCode() === 'usps') {
    $trackurl = 'https://tools.usps.com/go/TrackConfirmAction_input?qtc_tLabels1='.$_item->getNumber();
}elseif ($_item->getCarrierCode() === 'ups') {
    $trackurl = 'https://wwwapps.ups.com/WebTracking/returnToDetails?tracknum='.$_item->getNumber();
    <td><?= $block->escapeHtml($_item->getCarrierCode()) ?>:</td>

     <td style="padding:3px 9px"><a href="<?php echo $trackurl ?>"><?php echo $this->escapeHtml($_item->getNumber()) ?></a></td>


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.