I ordered some parts for my car today and was happy to see that the online vendor had a Magento website. Although the version was one of the oldest I’ve seen, the site was extremely fast, easy to navigate, and the checkout process went off without a hitch. Something to be said for function over form!
Anyway, I never received a shipment confirmation for my order. After emailing the vendor, I received a response that said “your order was shipped 3 days ago via USPS Ground”. I’ve emailed them back and asked why they don’t use Magento’s native shipment email which sends the tracking numbers to the customer when a shipment is created.
I quickly mocked up a shipment email in my demo site for them, and modded the email tracking code to include a clickable tracking number (native behavior doesn’t include a clickable tracking number, just a text one). I personally use Google to track packages, but you can substitute Boxoh if you prefer.
The code in my demo site was contained in: app/design/frontend/base/default/template/email/order/shipment/track.phtml. If you are running a custom theme (likely), change the /base/default/ in the path to your theme location. If it didn’t exist obviously we would copy …track/phtml to our theme to maintain the upgrade path.
Search for the method getNumber:
<td align=”center” valign=”top” style=”padding:3px 9px”><?php echo $this->escapeHtml($_item->getNumber()) ?></td>
To update to Google searching for the tracking number:
<td align=”center” valign=”top” style=”padding:3px 9px”><?php echo “<a href= ‘http://google.com/?t=”.$_item->getNumber().”&gws_rd=ssl#q=”.$_item->getNumber().”‘>”.$_item->getNumber().”</a>” ?></td>
Upload, clear your cache, and regression test. All set.
Shipped By | Tracking Number |
United States Postal Service | 9405510200883333578769 |