1. Don't forget to backup your prestashop file first
2. You need to edit the admin/tabs/AdminOrders.php file, inside is a function called postProcess
3. Find following code. Add the bold code inside it.
$templateVars = array(4. in your mail template for english it is in /mail/en/ named in_transit.html and in_transit.txt, add {shipping_number} where ever you want the tracking number to appear.
'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
'{firstname}' => $customer->firstname,
'{lastname}' => $customer->lastname,
'{shipping_number}' => $shipping_number,
'{id_order}' => (int)($order->id)
);
For latest version of prestashop (1.5 and above), you need to find the code in the controllers/admin/AdminOrdersController. Look for the following code
$order->shipping_number)$templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url));change it to :
if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') && $order->shipping_number)$templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
'{shipping_number}' => $order->shipping_number
);
There is a module that could make your life easier if you have lots of tracking number to input. This module could import all your tracking number at once. Orders will be updated and your customers will receive an email with the tracking URL of their parcels. Module features :
- Compatible from Prestashop 1.1 to 1.6
- You can choose the orders status after the import (most of the time “Shipped”)
- You can choose the CSV format to adapt the module to your needs: Header lines, column separator, columns numbers
- You can choose the identifier of your orders: Order ID, cart ID, invoice number or delivery number
- Free and automatic updates of the module
- Access personalized support directly from the module page