$('.shipping-information-link').each(function() { var link = $(this); var fullTrackingNum = $(this).html(); if (fullTrackingNum.indexOf("UPS") >= 0) { var UpsTrackingNum = fullTrackingNum.substr(fullTrackingNum.lastIndexOf(" ") + 1); var UpsCarrier = "https://www.ups.com/mobile/track?trackingNumber=" $(link).attr("href", UpsCarrier + UpsTrackingNum); } else if (fullTrackingNum.indexOf("Fedex") >= 0) { var FedexTrackingNum = fullTrackingNum.substr(fullTrackingNum.lastIndexOf(" ") + 1); var FedexCarrier = "https://www.fedex.com/apps/fedextrack/index.html?tracknumbers=" $(link).attr("href", FedexCarrier + FedexTrackingNum); } else if (fullTrackingNum.indexOf("Canada Post") >= 0) { var CpTrackingNum = fullTrackingNum.substr(fullTrackingNum.lastIndexOf(" ") + 1); var CpCarrier = "https://www.canadapost.ca/trackweb/en#/search?searchFor=" $(link).attr("href", CpCarrier + CpTrackingNum); } else if (fullTrackingNum.indexOf("USPS") >= 0) { var UspsTrackingNum = fullTrackingNum.substr(fullTrackingNum.lastIndexOf(" ") + 1); var UspsCarrier = "https://tools.usps.com/go/TrackConfirmAction?qtc_tLabels1=" $(link).attr("href", UspsCarrier + UspsTrackingNum); } });
If you have any ideas for portal customizations you'd like to see us tackle or need help implementing this tracking number code, email our support team at support@docketmanager.ca