Mister Denial Posted December 28, 2011 Share Posted December 28, 2011 Hello folks, is it possible to automatically add the tracking number set for an order to the email template "in transit"? Instead of the automatically generated link? Just the tracking number? Thanks for any tips and advice on how to do this, would be much appreciated! Happy holidays everyone! Dan Link to comment Share on other sites More sharing options...
KushMaster Posted January 2, 2012 Share Posted January 2, 2012 I also need help with this. I assumed the tracking numbers were viewable in the FO for the customer in their account, but have realized that this is not the case. The "In Transit" e-mail that is sent to the customer upon inputting the tracking number in the BO only provides a link to a website (I use USPS, so the link is http://www.usps.com as that is where the customer will track their package). This link would only be helpful if the tracking number that I input for individual customers is included in the same e-mail. At the very least, the number should be viewable somewhere in the customers' account, but it is not. Please help!! Thanks Link to comment Share on other sites More sharing options...
Mister Denial Posted January 16, 2012 Author Share Posted January 16, 2012 You can add the tracking number to the URL only, which works well with some transport companies, but fails on all where the tracking number is not part of the tracking URL. That's why I would like to include a link to the tracking website, and then the tracking number separately. Anyone got an idea? Link to comment Share on other sites More sharing options...
bellini13 Posted January 16, 2012 Share Posted January 16, 2012 you need to edit the admin/tabs/AdminOrders.php file, inside is a function called postProcess. Edit the section that looks like the following code, as you can see I have added 1 line of code with shipping_number $templateVars = array( '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{shipping_number}' => $shipping_number, '{id_order}' => (int)($order->id) ); then in your mail template named in_transit.html and in_transit.txt, add {shipping_number} where ever you want the tracking number to appear. 7 Link to comment Share on other sites More sharing options...
patuga Posted February 1, 2012 Share Posted February 1, 2012 Hi, first of all, many thanks for that solution. i have a sililar problem. I use two carriers, one has the tracking number on the url, the other one, does not. the way i see it, with this solution all carriers will behave like this. Is there a way to specify which "version" i want to use for each carrier, as well as each template to use, the idea is to have carrier #1 -> tracking number in url (use template #1) carrier #2 -> tracking number to page + "use this tracking number on search box" & tracking number. (use template #2) 1 Link to comment Share on other sites More sharing options...
bellini13 Posted February 2, 2012 Share Posted February 2, 2012 there are a few ways to accomplish that. you could create multiple templates and then based on the selected carrier, choose the template the use. if carrier #1 then use template1 else if carrier #2 then use template2 or only have a single template, and have the code generate the content that will be displayed, based on the selected carrier if carrier #1 then //assign a variable with the content to be displayed //use template 1 else if carrier #2 //assign a variable with the content to be displayed //use template 1 1 Link to comment Share on other sites More sharing options...
patuga Posted February 2, 2012 Share Posted February 2, 2012 thanks for the help however last night i thought that creating all that would be too troublesome and did the method described in this post and will have this method for all carriers. its not too much dificult, it's just a question of copy/pasting the code on the carriers page once again thanks for the help. Link to comment Share on other sites More sharing options...
Mister Denial Posted February 21, 2012 Author Share Posted February 21, 2012 Hi bellini13, works like a charm! Many thanks for your time and help, it's much appreciated! Kind regards, Dan Link to comment Share on other sites More sharing options...
canyon88 Posted March 9, 2012 Share Posted March 9, 2012 Hello, Thanks to Bellini for this solution it help me a lot. There is still another small problem, in the order history of the customer, the tracking number do not show up, only the tracking website url. How to do for add the tracking number also the same way like in the email template ? Notice: My carrier is EMS (China Post) so we cannot use the normal tracking function of prestashop. Link to comment Share on other sites More sharing options...
bellini13 Posted March 9, 2012 Share Posted March 9, 2012 do you enter the tracking number into the system? if so, where do you enter it? 1 Link to comment Share on other sites More sharing options...
canyon88 Posted March 9, 2012 Share Posted March 9, 2012 do you enter the tracking number into the system? if so, where do you enter it? Yes, of course I entered the tracking number in the fields "Shipping information". Then the order history of customer is updated only with the tracking website url. Note : If I add the @ in the carrier area then the tracking number is added but it looks not clear for customer : Click the following link to track the delivery of your order http://www.ems.com.cn/english.htmlee987654321cn What I want is it looks clear like this : Click the following link to track the delivery of your order http://www.ems.com.cn/english.html Tracking Number : EE987654321CN Thanks. Link to comment Share on other sites More sharing options...
bellini13 Posted March 10, 2012 Share Posted March 10, 2012 you would need to edit the orderdetailcontroller and the order-detail.tpl, so it does what you want. Link to comment Share on other sites More sharing options...
canyon88 Posted March 14, 2012 Share Posted March 14, 2012 you would need to edit the orderdetailcontroller and the order-detail.tpl, so it does what you want. I've find the code in both files, but I am unable to modify it correctly without crash everything (I am not professional). Can somebody help me with theses codes ? Here is the code for both files : orderdetailcontroller.php : if ($carrier->url AND $order->shipping_number) self::$smarty->assign('followup', str_replace('@', $order->shipping_number, $carrier->url)); self::$smarty->assign('HOOK_ORDERDETAILDISPLAYED', Module::hookExec('orderDetailDisplayed', array('order' => $order))); Module::hookExec('OrderDetail', array('carrier' => $carrier, 'order' => $order)); unset($carrier); unset($addressInvoice); unset($addressDelivery); order-detail.tpl : {if isset($followup)}<p class="bold">{l s='Click the following link to track the delivery of your order'}</p> <a href="{$followup|escape:'htmlall':'UTF-8'}">{$followup|escape:'htmlall':'UTF-8'}</a> {/if} 1 Link to comment Share on other sites More sharing options...
Spidersiteme Posted September 11, 2012 Share Posted September 11, 2012 HI bellini13, In the back office / order before i was able to input tracking number once the costumer order a product with UPS And now im not able to see this box Link to comment Share on other sites More sharing options...
ubergirl Posted September 14, 2012 Share Posted September 14, 2012 Hi Spiderme: Did you erase the link in the carrier? I think that if there is no link, the input box doesn appear in the BO order page. 1 Link to comment Share on other sites More sharing options...
solarm Posted November 9, 2012 Share Posted November 9, 2012 you need to edit the admin/tabs/AdminOrders.php file, inside is a function called postProcess. Edit the section that looks like the following code, as you can see I have added 1 line of code with shipping_number $templateVars = array( '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{shipping_number}' => $shipping_number, '{id_order}' => (int)($order->id) ); then in your mail template named in_transit.html and in_transit.txt, add {shipping_number} where ever you want the tracking number to appear. The file in 1.5.2 version is located in controllers/admin/AdminOrdersController.php Link to comment Share on other sites More sharing options...
Pressed0024 Posted November 12, 2012 Share Posted November 12, 2012 Use this instead 1.5.2.: '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{id_order}' => $order->id, '{shipping_number}' => $order->shipping_number, '{order_name}' => $order->getUniqReference() 2 Link to comment Share on other sites More sharing options...
josal Posted November 15, 2012 Share Posted November 15, 2012 Great, and what about adding all the combinations (not only the first one) in the product description for the new order email template? If it works I'll add it to more places in the backoffice... I'm currently trying to do it because it seems the $itemsTable variable inside /modules/mailalerts/mailalerts.php file only refers to $product['attributes_small'] variable, which seems to have only the first combination. Maybe there is a $product['attributes'] with all the combinations, not only the first one? Another strange thing is that if I modify this $itemsTable variable, for example, in order to change the background of the table, it doesn't change at all. So, I haven't been able to write a var_dump in order to see the $product fields... I'm using Prestashop 1.4.6.2. Thanks in advance!! Link to comment Share on other sites More sharing options...
FredCD Posted January 3, 2013 Share Posted January 3, 2013 It doesn't work for me. I use 1.5.2 I added the "declaration" of tracking number field in controllers/admin/AdminOrders.php (as shown by Pressed0024). I've created a new mail template (based on "in_transit.html/txt"), wrote some sentence containing '{shipping_number}' (without the quotes of courses) and associated it with a brand new status. When i switch to this status the system send an email but instead of getting the tracking number the text contains {shipping_number} as plain text Any idea ?? Link to comment Share on other sites More sharing options...
giokookie Posted January 9, 2013 Share Posted January 9, 2013 It doesn't work for me. I use 1.5.2 I added the "declaration" of tracking number field in controllers/admin/AdminOrders.php (as shown by Pressed0024). I've created a new mail template (based on "in_transit.html/txt"), wrote some sentence containing '{shipping_number}' (without the quotes of courses) and associated it with a brand new status. When i switch to this status the system send an email but instead of getting the tracking number the text contains {shipping_number} as plain text Any idea ?? I have the same problem too. However, i added {shipping_number} to the existing email template and {shipping_number} shows upon the customer email. I'm using version 1.4.0 Any tips? 1 Link to comment Share on other sites More sharing options...
Pressed0024 Posted January 9, 2013 Share Posted January 9, 2013 So what can we conclude from this? Moral of the story? Prestashop is just f'ed up with buggy releases. Use the "prestashop forge" and "prestashop github" to report issue to them. I seriously regretted going with Prestashop. I am now stuck with Prestashop Link to comment Share on other sites More sharing options...
giokookie Posted January 9, 2013 Share Posted January 9, 2013 After playing around with it i realised that you cannot put anything after {shipping_number} Not even a '.' (full stop). that was what caused the number not to show up. After i remove the full stop, the number showed correctly. Link to comment Share on other sites More sharing options...
FredCD Posted January 14, 2013 Share Posted January 14, 2013 I don't get it Where do you avoid putting something after {shipping_number} ? Which file ? AdminOrdersController.php ? in_transit.html ? _shipping.tpl ? And what version of PS ? 1.4.x or 1.5.x ? Link to comment Share on other sites More sharing options...
Fmarta Posted January 18, 2013 Share Posted January 18, 2013 It didnt work form me usin prestashop 1.5.3 and only appears in the mail {shipping_number} Link to comment Share on other sites More sharing options...
AppleEater Posted February 3, 2013 Share Posted February 3, 2013 (edited) Works on PS 1.5.3.1 Use this instead 1.5.2.: '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{id_order}' => $order->id, '{shipping_number}' => $order->shipping_number, '{order_name}' => $order->getUniqReference() Edited February 3, 2013 by AppleEater (see edit history) Link to comment Share on other sites More sharing options...
thief_58 Posted March 2, 2013 Share Posted March 2, 2013 hello have verison prestashop 1.5.3.1. my e-mail templates are working perfectly, but when I wanted to update the shipping tracking number hes generate order number auto. i mean cannot update tracking number any idea ? my engilish bad . thankyou for interesting. Link to comment Share on other sites More sharing options...
patuga Posted March 21, 2013 Share Posted March 21, 2013 (edited) Hi Guys, thanks for the tips. i managed to get it to work so here's what i did... serched in file "AdminOrdersController.php" for this code: '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{id_order}' => $order->id, then added this line under it, like instructed: {shipping_number}' => $order->shipping_number, then on my in_transit.html file i added this line: <p>And using the following Tracking Number: <strong>{shipping_number}</strong></p></td> after this one: <br />You can track your package using the following <a href="{followup}"><strong>Link...</strong></a></p> and now everything is working perfectly i'm using version 1.5.3.1 TKS :D Edited March 21, 2013 by patuga (see edit history) 2 Link to comment Share on other sites More sharing options...
Pressed0024 Posted March 21, 2013 Share Posted March 21, 2013 Hi Guys, thanks for the tips. i managed to get it to work so here's what i did... serched in file "AdminOrdersController.php" for this code: '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{id_order}' => $order->id, then added this line under it, like instructed: {shipping_number}' => $order->shipping_number, then on my in_transit.html file i added this line: <p>And using the following Tracking Number: <strong>{shipping_number}</strong></p></td> after this one: <br />You can track your package using the following <a href="{followup}"><strong>Link...</strong></a></p> and now everything is working perfectly i'm using version 1.5.3.1 TKS :D Can you report this bug in forge.prestashop.com so it can be included in the next release update? 1 Link to comment Share on other sites More sharing options...
patuga Posted March 22, 2013 Share Posted March 22, 2013 (edited) how? i don't think it's a bug, but more like a feature people want to add. because it works fine when you have a carrier like dhl or ups. (when the tracking number is part of the url) Edited March 22, 2013 by patuga (see edit history) Link to comment Share on other sites More sharing options...
Pressed0024 Posted March 23, 2013 Share Posted March 23, 2013 Any carrier you create should work, it does not only have to be DHL or UPS Link to comment Share on other sites More sharing options...
jose_rui_sa Posted March 23, 2013 Share Posted March 23, 2013 (edited) where is located the file? im tired searching it...(ive google too) SOLVED Its named AdminOrders.php Hi Guys, thanks for the tips. i managed to get it to work so here's what i did... serched in file "AdminOrdersController.php" for this code: '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{id_order}' => $order->id, then added this line under it, like instructed: {shipping_number}' => $order->shipping_number, then on my in_transit.html file i added this line: <p>And using the following Tracking Number: <strong>{shipping_number}</strong></p></td> after this one: <br />You can track your package using the following <a href="{followup}"><strong>Link...</strong></a></p> and now everything is working perfectly i'm using version 1.5.3.1 TKS :D Edited March 23, 2013 by jose_rui_sa (see edit history) 1 Link to comment Share on other sites More sharing options...
Regenesis Posted April 10, 2013 Share Posted April 10, 2013 Hi Guys, It not works for me. Im using 1.4.6 (dont wanna upgrade to 1.5) After adding thos code as suggested, i cannot see my orders in bo. Received an error : Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /.........../public_html/adminonly/tabs/AdminOrders.php on line 558 Please help. Link to comment Share on other sites More sharing options...
conidig Posted May 12, 2013 Share Posted May 12, 2013 but how i put the tracking number on backoffices order? Link to comment Share on other sites More sharing options...
bellini13 Posted May 12, 2013 Share Posted May 12, 2013 but how i put the tracking number on backoffices order? you click the edit link next to the tracking number and enter it Link to comment Share on other sites More sharing options...
conidig Posted May 12, 2013 Share Posted May 12, 2013 sorry, i can't find it.. you mean the order page? Link to comment Share on other sites More sharing options...
1Click Posted June 14, 2013 Share Posted June 14, 2013 yes it works on 1.5.2. Just need couple of arrangements fixing the displacement of the text in the message. Link to comment Share on other sites More sharing options...
sshare Posted June 23, 2013 Share Posted June 23, 2013 I used Bellini's solution on 1.4.7 and it works great the tracking number now get's displayed in the "in transit" email, and I also edited the link in the email manually so that you don't get the URL + the tracking number but just the URL. One slight problem though, when a customer logs in, on the order-detail.tpl they can see the tracking number too, how do I get it to appear there, as I've edited order-detail.tpl but the tracking number doesn't appear it's just blank when I try to use {shipping_number} so I assume I need to add some extra call to call the shipping number up or something? Please help as I would like it to appear for both logged in clients and guest tracking, so I guess it will be in OrderDetailController and GuestTrackingController, but I have no idea what to edit/add. Link to comment Share on other sites More sharing options...
sshare Posted June 23, 2013 Share Posted June 23, 2013 Nevermind go figure, cant work it out so post up on the forum and then 5 mins after that I make it work. My error was I had {$shipping_number|escape:'htmlall':'UTF-8'} in the order-detail.tpl when in fact I needed {$order->shipping_number|escape:'htmlall':'UTF-8'} I then edited the tracking URL and it all works beautifully now. Link to comment Share on other sites More sharing options...
askinjew Posted July 18, 2013 Share Posted July 18, 2013 there are a few ways to accomplish that. you could create multiple templates and then based on the selected carrier, choose the template the use. if carrier #1 then use template1 else if carrier #2 then use template2 or only have a single template, and have the code generate the content that will be displayed, based on the selected carrier if carrier #1 then //assign a variable with the content to be displayed //use template 1 else if carrier #2 //assign a variable with the content to be displayed //use template 1 it is work with prestashop 1.5.4.1 thanks a lot you are nice and many peopel they look this answer. you need to edit the admin/tabs/AdminOrders.php file, inside is a function called postProcess. Edit the section that looks like the following code, as you can see I have added 1 line of code with shipping_number $templateVars = array( '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{shipping_number}' => $shipping_number, '{id_order}' => (int)($order->id) ); then in your mail template named in_transit.html and in_transit.txt, add {shipping_number} where ever you want the tracking number to appear. Link to comment Share on other sites More sharing options...
Vilas Posted August 4, 2013 Share Posted August 4, 2013 you need to edit the admin/tabs/AdminOrders.php file, inside is a function called postProcess. Edit the section that looks like the following code, as you can see I have added 1 line of code with shipping_number $templateVars = array( '{followup}' => str_replace('@', $order->shipping_number, $carrier->url), '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{shipping_number}' => $shipping_number, '{id_order}' => (int)($order->id) ); then in your mail template named in_transit.html and in_transit.txt, add {shipping_number} where ever you want the tracking number to appear. Dear Friend, I am using Prestashop 1.5.4.1 in that I am unable to find such file. Will be great if you suggest solution on it? Which file should I have to be modified? Thanks Link to comment Share on other sites More sharing options...
Vilas Posted August 4, 2013 Share Posted August 4, 2013 there are a few ways to accomplish that. you could create multiple templates and then based on the selected carrier, choose the template the use. if carrier #1 then use template1 else if carrier #2 then use template2 or only have a single template, and have the code generate the content that will be displayed, based on the selected carrier if carrier #1 then //assign a variable with the content to be displayed //use template 1 else if carrier #2 //assign a variable with the content to be displayed //use template 1 Where to mention it? As I have 2 carrier installed. Customer may be select anyone between these two. Even we can ship other carrier than he selected. In such cases what will be solution? Thanks Link to comment Share on other sites More sharing options...
bellini13 Posted August 4, 2013 Share Posted August 4, 2013 For v1.5, the file should be controllers\admin\AdminOrdersController.php 1 Link to comment Share on other sites More sharing options...
Vilas Posted August 15, 2013 Share Posted August 15, 2013 Dear Bellini Thanks for details. But how to create that script of carrier selection through back office? Thanks Link to comment Share on other sites More sharing options...
bellini13 Posted August 15, 2013 Share Posted August 15, 2013 Vilas, I don't understand your question or what you are trying to accomplish Link to comment Share on other sites More sharing options...
Vilas Posted August 16, 2013 Share Posted August 16, 2013 I apologize for it. I have 2 carrier installed. Customer may be select anyone between these two. But what if we ship using other courier which he not selected. In such cases how to change shipping partner name while entering tracking number? E.g. I have below 2 carriers. FEDEX UPS Customer selected FEDEX. Shipped through UPS then how to select UPS for shipping it? Because system automatically consider courier partner which is selected during checkout by customer. Thanks 2 Link to comment Share on other sites More sharing options...
mouse1 Posted January 15, 2014 Share Posted January 15, 2014 I already had the code '{shipping_number}' => $order->shipping_number, in my AdminOrdersController.php file, but when I added {shipping_number} in a new template, the number didn't show and I just got {shipping_number}. So this is what I did: I added the same code... '{shipping_number}' => $order->shipping_number, ...in the file classes/order/OrderHistory.php after line '{id_order}' => (int)$this->id_order, So now it looks like this: if (isset($result['template']) && Validate::isEmail($result['email'])) { $topic = $result['osname']; $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{shipping_number}' => $order->shipping_number, '{order_name}' => $order->getUniqReference() ); Now it's working in my template. 7 Link to comment Share on other sites More sharing options...
dtl Posted January 31, 2014 Share Posted January 31, 2014 Hello everyone i am with PrestaShop 1.5.6.1, i try everything that you tell, but in new version of prestashop it does not work. in email it show up like {shipping_number} Do you have idea of what can i do to work ? I need only shipping number to show, without any URL for tracking. Thanks! Link to comment Share on other sites More sharing options...
jdepluvie Posted June 12, 2014 Share Posted June 12, 2014 (edited) Hello I alm using 1.4.11 an 1.4.9 PS I see the shipping_number is OK when you use in_transit.html when you add portion of code. but how can we add the shipping number in other mail like shipped.html or invoice.html. because the code is only for the case : you clic on submitShippingNumber (/* Update shipping number */) where do i add code in this option : /* Change order state, add a new entry in order history and send an e-mail to the customer if needed */ Thanks a lot /* Change order state, add a new entry in order history and send an e-mail to the customer if needed */ elseif (Tools::isSubmit('submitState') AND ($id_order = (int)(Tools::getValue('id_order'))) AND Validate::isLoadedObject($order = new Order($id_order))) { if ($this->tabAccess['edit'] === '1') { $_GET['view'.$this->table] = true; if (!$newOrderStatusId = (int)(Tools::getValue('id_order_state'))) $this->_errors[] = Tools::displayError('Invalid new order status'); else { $history = new OrderHistory(); $history->id_order = (int)$id_order; $history->id_employee = (int)($cookie->id_employee); $history->changeIdOrderState((int)($newOrderStatusId), (int)($id_order)); $order = new Order((int)$order->id); $carrier = new Carrier((int)($order->id_carrier), (int)($order->id_lang)); $templateVars = array(); if ($history->id_order_state == Configuration::get('PS_OS_SHIPPING') AND $order->shipping_number) $templateVars = array('{followup}' => str_replace('@', $order->shipping_number, $carrier->url)); elseif ($history->id_order_state == Configuration::get('PS_OS_CHEQUE')) $templateVars = array( '{cheque_name}' => (Configuration::get('CHEQUE_NAME') ? Configuration::get('CHEQUE_NAME') : ''), '{cheque_address_html}' => (Configuration::get('CHEQUE_ADDRESS') ? nl2br(Configuration::get('CHEQUE_ADDRESS')) : '')); elseif ($history->id_order_state == Configuration::get('PS_OS_BANKWIRE')) $templateVars = array( '{bankwire_owner}' => (Configuration::get('BANK_WIRE_OWNER') ? Configuration::get('BANK_WIRE_OWNER') : ''), '{bankwire_details}' => (Configuration::get('BANK_WIRE_DETAILS') ? nl2br(Configuration::get('BANK_WIRE_DETAILS')) : ''), '{bankwire_address}' => (Configuration::get('BANK_WIRE_ADDRESS') ? nl2br(Configuration::get('BANK_WIRE_ADDRESS')) : '')); if ($history->addWithemail(true, $templateVars)) Tools::redirectAdmin($currentIndex.'&id_order='.$id_order.'&vieworder'.'&token='.$this->token); $this->_errors[] = Tools::displayError('An error occurred while changing the status or was unable to send e-mail to the customer.'); } } else $this->_errors[] = Tools::displayError('You do not have permission to edit here.'); } Edited June 12, 2014 by jdepluvie (see edit history) 1 Link to comment Share on other sites More sharing options...
motion2082 Posted June 27, 2015 Share Posted June 27, 2015 I already had the code '{shipping_number}' => $order->shipping_number, in my AdminOrdersController.php file, but when I added {shipping_number} in a new template, the number didn't show and I just got {shipping_number}. So this is what I did: I added the same code... '{shipping_number}' => $order->shipping_number, ...in the file classes/order/OrderHistory.php after line '{id_order}' => (int)$this->id_order, So now it looks like this: if (isset($result['template']) && Validate::isEmail($result['email'])) { $topic = $result['osname']; $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{shipping_number}' => $order->shipping_number, '{order_name}' => $order->getUniqReference() ); Now it's working in my template. This worked perfectly for me, thank you 2 Link to comment Share on other sites More sharing options...
trameta Posted October 12, 2015 Share Posted October 12, 2015 Hi anyone! i need help - presta dont add tracking number in to the link. Seems replace'@' shipping number doesnt work. How can i fix it? Link to comment Share on other sites More sharing options...
Grindelf Posted February 29, 2016 Share Posted February 29, 2016 jUST FOLLOW THE MOUSE1 TIP WORKS ON LAST VERSION OF PS UNTIL TODAY TY VERY MUCH Link to comment Share on other sites More sharing options...
dmouradov Posted March 12, 2016 Share Posted March 12, 2016 For presta 1.6.0.9 its working https://www.prestashop.com/forums/topic/269324-how-can-we-add-tracking-url-variable-to-shipped-mail-template/?p=1402070 Link to comment Share on other sites More sharing options...
Mister Denial Posted April 18, 2016 Author Share Posted April 18, 2016 As I have seen many threads about this, just for info, in 1.6.1.14 you don't need to edit any of the core files. Simply add {shipping_number} in your email template, and it will be replaced by the tracking number. 1 Link to comment Share on other sites More sharing options...
ccw0103 Posted July 25, 2016 Share Posted July 25, 2016 As I have seen many threads about this, just for info, in 1.6.1.14 you don't need to edit any of the core files. Simply add {shipping_number} in your email template, and it will be replaced by the tracking number. Hi, I am using 1.6.1.16 and it is still showing the text {shipping_number} in the email??? Link to comment Share on other sites More sharing options...
bellini13 Posted July 25, 2016 Share Posted July 25, 2016 Hi, I am using 1.6.1.16 and it is still showing the text {shipping_number} in the email??? 1) which email did you change? which email are you expecting the tracking number to appear in? 2) when did you add a tracking number to the order? 3) are you expecting the tracking number to appear in the carrier tracking URL? Link to comment Share on other sites More sharing options...
ccw0103 Posted July 26, 2016 Share Posted July 26, 2016 1) which email did you change? which email are you expecting the tracking number to appear in? 2) when did you add a tracking number to the order? 3) are you expecting the tracking number to appear in the carrier tracking URL? Hi, I add the {shipping_number} in the in_transit email, as a seperate line, this email will be sent when I add the tracking number in the back office, after the shipped status.... it used to work fine, but now it just showing the text... i am not expecting this in the tracking URL... Link to comment Share on other sites More sharing options...
bellini13 Posted July 27, 2016 Share Posted July 27, 2016 so what have you changed since it working and not working? install a module, override theme... Link to comment Share on other sites More sharing options...
glouk7 Posted September 5, 2017 Share Posted September 5, 2017 I already had the code '{shipping_number}' => $order->shipping_number, in my AdminOrdersController.php file, but when I added {shipping_number} in a new template, the number didn't show and I just got {shipping_number}. So this is what I did: I added the same code... '{shipping_number}' => $order->shipping_number, ...in the file classes/order/OrderHistory.php after line '{id_order}' => (int)$this->id_order, So now it looks like this: if (isset($result['template']) && Validate::isEmail($result['email'])) { $topic = $result['osname']; $data = array( '{lastname}' => $result['lastname'], '{firstname}' => $result['firstname'], '{id_order}' => (int)$this->id_order, '{shipping_number}' => $order->shipping_number, '{order_name}' => $order->getUniqReference() ); Now it's working in my template. Thanks it worked!!!!! Version 1.6.1.12 Link to comment Share on other sites More sharing options...
veltors Posted September 8, 2017 Share Posted September 8, 2017 I found a solutin. My Prestashop is 1.6.16 I have changed the lines from 409 to 413 $templateVars = array('{shipping_number}' => $order->shipping_number);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); and i have edited the "in transit" email template in the BO. I have added {shipping_number} and other details like email template "Shipped" and then unclicked shipped email template from status to not send email to recevier because when you add tracking number the received get all details about order status and tracking nuber and carriers page details. It works perfectly. Best Regards . Link to comment Share on other sites More sharing options...
Recommended Posts