Fixing a bug - shipper tracking number in customer email

In this board, we will periodically list various tips and tricks we find that may help in your use of PrestaShop. This will also include tips on the use of Agile modules. If you have a great tip, fix, or workaround for a PrestaShop feature, feel free to post it here...

Fixing a bug - shipper tracking number in customer email

Postby shokinro » Sat Apr 06, 2013 1:32 am

PrestaShop provides very powerful shipping carrier management features. One of the important features is that you can enter a shipper's tracking number and an "in transit" email will automatically be sent to your customer to notify them the purchase has shipped. In this "in transit" email, the link to the online tracking website will be included - as long as you have provided this information in the carrier.

How it works:
================
1. When you create a shipping carrier, enter the URL of the shipper's online tracking system as follows, with @ as the placeholder of the tracking number. The format of the URL will vary from carrier to carrier, but the following is an example:

http : //mycarrier.com/tracking?@

2. When the purchased item is shipped, simply add the tracking number in the Shipping carrier section on the Orders -> Order detail page of the PrestaShop back office.
One you enter the tracking number, PrestaShop will automatically send out an "in transit" email to the customer with the online tracking link in the email.

The issue (or bug ):
=============
If the order has multiple shipping carriers (this is also a new PrestaShop feature starting with version 1.5x), then PrestaShop may not be able to send the link correctly in the "in transit" email. This is because a bug in the PHP code.

How to fix:
==========
Change one line of code (line # 294, PrestaShop 1.5.4.0) in the file /controllers/admin/AdminOrdersController.php:

From:
Code: Select all
   $carrier = new Carrier((int)$order->id_carrier, $order->id_lang);


To:
Code: Select all
   $carrier = new Carrier((int)$order_carrier->id_carrier, $order->id_lang);


Hope this helps..
Follow us at Twitter Like us on Facebook Watch our Tutorial Videos on YouTube
shokinro
Site Admin
 
Posts: 3091
Joined: Sat Jun 25, 2011 3:08 pm

Return to Tips and Tricks for PrestaShop and Agile Modules

Who is online

Users browsing this forum: No registered users and 2 guests