Jump to content

[SOLVED] how to make the tracking number appears in the "in transit" email


Recommended Posts

hi

Normally, when we got the tracking no. from the post office.
I put it in the box in BackOffice->Order->"Shipping Information"
and click the button next to it, then i'll send the mail to the customer right?

but the mail it sent is not include the tracking no.
It shows only the link used to check it like the picture i attached.

The question is
anybody has any idea how to make the tracking number appears in the "in transit email"
when it is sent to the customer after i entered in the tracking number?

40459_IdpRXpKT74wwGfcThL64_t

40460_qhYWcFERfiKkpEeT45JH_t

Link to comment
Share on other sites

#
#----------[ OPEN ]----------
#
admin/AdminOrders.pp

#
#----------[ FIND ]----------
#
'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),

#
#----------[ AFTER, ADD ]----------
#
'{shippingnumber}' => $order->shipping_number,

#
#----------[ OPEN ]----------
#
mails/(your language)/in_transit.html
mails/(your language)/in_transit.txt

#
#----------[ ADD, WHERE YOU WANT ]----------
#
{shippingnumber}





i went to my admin folder which i have change the name to "dudeking"
and the problem is i cant find the "adminOrder.php" file

plss help

im really a newbie sorry
Link to comment
Share on other sites

#
#----------[ OPEN ]----------
#
admin/tabs/AdminOrders.php

#
#----------[ FIND ]----------
#
'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),

#
#----------[ AFTER, ADD ]----------
#
'{shippingnumber}' => $order->shipping_number,

#
#----------[ OPEN ]----------
#
mails/(your language)/in_transit.html
mails/(your language)/in_transit.txt

#
#----------[ ADD, WHERE YOU WANT ]----------
#
{shippingnumber}





i went to my admin folder which i have change the name to "dudeking"
and the problem is i cant find the "adminOrder.php" file

plss help

im really a newbie sorry


"AdminOrders.php" file is in admin/tabs folder. In your case, it'll be dudeking/tabs .
Link to comment
Share on other sites

#
#----------[ OPEN ]----------
#
admin/tabs/AdminOrders.php

#
#----------[ FIND ]----------
#
'{followup}' => str_replace('@', $order->shipping_number, $carrier->url),

#
#----------[ AFTER, ADD ]----------
#
'{shippingnumber}' => $order->shipping_number,

#
#----------[ OPEN ]----------
#
mails/(your language)/in_transit.html
mails/(your language)/in_transit.txt

#
#----------[ ADD, WHERE YOU WANT ]----------
#
{shippingnumber}





i went to my admin folder which i have change the name to "dudeking"
and the problem is i cant find the "adminOrder.php" file

plss help

im really a newbie sorry


"AdminOrders.php" file is in admin/tabs folder. In your case, it'll be dudeking/tabs .





super Duper Thx u :)
it's work perfectly!!
Link to comment
Share on other sites

  • 1 month later...

I have another issue, I did entered the tracking number but I just don't get any link after 'You can track your package by clicking on the following link:' text. I followed Zenith instructions, but nothing changed. What could be the problem??

Link to comment
Share on other sites

I have another issue, I did entered the tracking number but I just don't get any link after 'You can track your package by clicking on the following link:' text. I followed Zenith instructions, but nothing changed. What could be the problem??


I made a new test order and link is now displayed normally. I guess these changes won't affect previous orders ... Thank you indeed!
Link to comment
Share on other sites

I have another issue, I did entered the tracking number but I just don't get any link after 'You can track your package by clicking on the following link:' text. I followed Zenith instructions, but nothing changed. What could be the problem??


I made a new test order and link is now displayed normally. I guess these changes won't affect previous orders ... Thank you indeed!


Suddenly it stops to work again, instead of link I get only shipping number (like 12345678901234) which links to "http://12345678901234/" which is no use ... I didn't do anything so what could be the problem here?? The link is normally displayed in Order histor and in BO ...
Link to comment
Share on other sites

  • 4 weeks later...

Hallo kiddycow,

i have the same problem than salko. I used your code but it doesn't work.
Could you have a look at my code below?

Admin->tabs->AdminOrders.php

    $templateVars = array(
                       '{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
                       '{shippingnumber}' => $order->shipping_number,
                       '{firstname}' => $customer->firstname,
                       '{lastname}' => $customer->lastname,
                       '{id_order}' => intval($order->id),
                       /*added21.04.2011*/'{colis}' => $order->shipping_number,        



Do i have to change in the same file my code here?

{
                   $history = new OrderHistory();
                   $history->id_order = $id_order;
                   $history->changeIdOrderState(intval($newOrderStatusId), intval($id_order));
                   $history->id_employee = intval($cookie->id_employee);
                   $carrier = new Carrier(intval($order->id_carrier), intval($order->id_lang));
                   $templateVars = array('{followup}' => ($history->id_order_state == _PS_OS_SHIPPING_ AND $order->shipping_number) ? str_replace('@', $order->shipping_number, $carrier->url) : '');
                   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 status or was unable to send e-mail to the customer');
               }



and in my mail it looks like that

               Vous pouvez suivre l'avancement de la livraison à l'adresse suivante : {shippingnumber}



I try to fix this for months now. I hope you can help me.

THANKS A LOT!

Silki

Link to comment
Share on other sites

Admin->tabs->AdminOrders.php should look like this (there is only one (1) place to add the code!)

                     $templateVars = array(
                       '{followup}' => str_replace('@', $order->shipping_number, $carrier->url),
                       '{shippingnumber}' => $order->shipping_number,
                       '{firstname}' => $customer->firstname,
                       '{lastname}' => $customer->lastname,
                       '{id_order}' => (int)($order->id)
                   );

Remove this:

 /*added21.04.2011*/'{colis}' => $order->shipping_number, 



I don't know why you have that.

My e-mail template looks like this (clickable tracking number):

                You can track the progress of your package online by clicking on the following link: {shippingnumber}



If you want to add the full URL also, change to something like this:

                You can track the progress of your package online by clicking on the following link: {shippingnumber}
{followup}



Hope that helps :)

Link to comment
Share on other sites

Thanks for your help. but it doesn't work...
I copied your code, deleted the line you told me and added the link in my mail but it still looks like this:

You can track the progress of your package online by clicking on the following link:{shippingnumber}

Is there another php which i need to adapt? Any idea?

Thanks a lot!!!

Silki

Link to comment
Share on other sites

  • 1 year later...

Hi Zenith and silki,

 

I am having the same issue like yours.. i believe i have changed all that is informed in the many different forum topics including this.

but yet, i am seeing {shipping_number} in the email... what did you change..? I will send my php file and html file, can you please please... take a look? i have been trying to fix this so long...

 

Please help me...

shippingnumber.zip

Edited by futureyoon (see edit history)
Link to comment
Share on other sites

Your files are correct futureyoon, so I'm not sure why it's not working for you.

 

You could try replacing the additional code in the Admin file with:

 

'{shipping_number}' => $order->shipping_number,

 

This is the same code used for the hyperlink.

Link to comment
Share on other sites

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...