Page 1 of 1

Fixing a bug - shipper tracking number in customer email

PostPosted: Sat Apr 06, 2013 1:32 am
by shokinro
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..