Prestashop Tracking in Customer Account

The other day while working on one of my clients shops, I noticed something. In Prestashop, when you send a tracking number after a purchase, nothing is posted in the account of the user. At first I thought it was a bug, but come to find out, that is just the way that it works. I know that Prestashop sends a tracking email to the customer after the purchase, but if that person in turn accidentally deletes that email, there is no place to find the tracking number. So I went ahead and added tracking to the customer account, and this is how I did it.

 

Customer account before

Prestashop Order Tracking

 

 

The Code

If you are using version 1.4 this is the code that will give you a tracking number.

{if $order.shipping_number}<a href="http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=@{$order.shipping_number|escape:'htmlall':'UTF-8'}" title="{l s='Track Order'}">{l s='Track Order'}</a>{/if}

and if you are using 1.5 you would use this syntax

{if $order->shipping_number}<a href="http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum=@{$order->shipping_number|escape:'htmlall':'UTF-8'}" title="{l s='Track Order'}">{l s='Track Order'}</a>{/if}

You would need to insert this snippet on the history.tpl page. I just inserted it right under the invoice in the template I took screen shots of. Notice also that I have the USPS tracking link, if you are using another carrier, you will have to use their tracking link. Below is what the customer account looks like after adding the tracking information.

Customer Account After

Prestashop Order Tracking

 

One thing you will notice after doing this is reduced customer service emails, which save time for the shop owners and in turn make them more money, because of reduced staffing.

 

About the Author: Lesley Paone

Lesley has worked in e-commerce for over a decade, and is the founder of dh42. Starting out with PrestaShop and brancing out into other platforms like Shopify. He loves all things e-commerce and loves a challenge, in his spare time he helps moderate several forums on SEO, e-commerce, as well as the PrestaShop forum. If you have any questions for him about any of his articles just use our contact form to contact him.

Share: