johnchristy Posted March 5, 2019 Share Posted March 5, 2019 Hi Friends, So finally I managed to add tracking number to email template & and I'm going to share that method. My Prestashop version - 1.6.1.23 1) Open - ~/classes/order/OrderHistory.php 2) Go to line 423 3) Change this code : $topic = $result['osname']; $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference() ); to : $topic = $result['osname']; $traking_number = $order->shipping_number; if ($traking_number =='') { $traking_number ='TRACKING_NUMBER_ID'.(int)$this->id_order; } $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{order_name}' => $order->getUniqReference(), '{tracking_number}' => $traking_number ); Screenshot - https://www.dropbox.com/s/4wyxyb0ec2b8lb3/2019-03-05_23-03-26.png?dl=0 4) Edit your email template - i.e. ~/mails/en/payment.html 5) Add this code : {tracking_number} i.e - Your trackign number <strong><span style="color:#333">{tracking_number}</span></strong></span> 6) Enjoy! Final output - Screenshots : https://www.dropbox.com/s/fubunumuppdgwnr/2019-03-05_23-07-24.png?dl=0https://www.dropbox.com/s/liigd027iajxcri/2019-03-05_23-08-28.png?dl=0NOTE : You must update your tracking number before you send this email notification. If not, {tracking_code} variable will be replaced with a string like "TRACKING_NUMBER_ID5" Cheers 1 Link to comment Share on other sites More sharing options...
todoboho Posted July 7, 2019 Share Posted July 7, 2019 (edited) thanks is work on 1.7.5 Edited July 7, 2019 by todoboho (see edit history) 1 Link to comment Share on other sites More sharing options...
Yulia Vitun Posted June 22, 2022 Share Posted June 22, 2022 On 7/7/2019 at 4:58 AM, todoboho said: thanks is work on 1.7.5 How di you do it? the code on 1.7.6.5 is different Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now