Jump to content

Add tracking number into e-mail template "shipped"


jjpljjpl

Recommended Posts

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.

  • Like 1
Link to comment
Share on other sites

 

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

  • 7 months 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...