jjpljjpl Posted August 2, 2022 Share Posted August 2, 2022 Hello It is possible to add tracking number into e-mail template "shipped" in prestashop 1.7.4.8? I found alot of guides on old Prestashop versions but not in the newer one. I feel the code is different. Link to comment Share on other sites More sharing options...
lordignus Posted August 2, 2022 Share Posted August 2, 2022 Add this function to the OrderHistory class. public function getTrackingNumber($id_order){ $order = new Order($id_order); $order_carrier = new OrderCarrier($order->getIdOrderCarrier()); $tracking_number = $order_carrier->tracking_number; return $tracking_number; } Then, in the sendEmail method of the same class, you'll find an array called $data which contains the email variables. Add to the array: '{tracking_number}' => $this->getTrackingNumber($this->id_order), Finally, add to your shipped email template something like "Your tracking number is {tracking_number}" or whatever you want it to say. 1 Link to comment Share on other sites More sharing options...
jjpljjpl Posted August 3, 2022 Author Share Posted August 3, 2022 Hello! When you say orderhistory class. What you mean then? In orderhistory file in FTP? Also what you mean with sendemail method? Can you please explain a bit as i am not a professional developer 18 hours ago, lordignus said: Add this function to the OrderHistory class. public function getTrackingNumber($id_order){ $order = new Order($id_order); $order_carrier = new OrderCarrier($order->getIdOrderCarrier()); $tracking_number = $order_carrier->tracking_number; return $tracking_number; } Then, in the sendEmail method of the same class, you'll find an array called $data which contains the email variables. Add to the array: '{tracking_number}' => $this->getTrackingNumber($this->id_order), Finally, add to your shipped email template something like "Your tracking number is {tracking_number}" or whatever you want it to say. Link to comment Share on other sites More sharing options...
jjpljjpl Posted August 9, 2022 Author Share Posted August 9, 2022 No one that can help us? Link to comment Share on other sites More sharing options...
lordignus Posted August 9, 2022 Share Posted August 9, 2022 5 hours ago, jjpljjpl said: No one that can help us? I've sent you a message 👍 Link to comment Share on other sites More sharing options...
MONASHOP Posted March 20, 2023 Share Posted March 20, 2023 Hello @lordignus , could you please detail me too ? 😇 Thank you very much 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