Jump to content

Replace order_name by id_order in email templates


Recommended Posts

Hi All,

 

In my PS 1.6.1, all the email (confirm, preparation, shipped etc...) show the variable "reference" {order_name} instead of {id_order}. For the customers it's not easy to remember this random mix of letters and numbers.

 

So I think it's possible to replace {order_name} by {id_order} in all email templates but i'm looking for a quicker and easier solution: modify the php file which pilots these templates and modify it to assign $id_order to {order_name} instead of reference.

 

Could you help me ? What is the class or controller concerned by email templates ?

 

Link to comment
Share on other sites

Hi and thanks.

Finally I found the solution after a good night  :)

 

Everywhere it was needed, I overrided classes/controllers and replace the {order_name} instruction, by example: I whish to modify the contact form and show the order_id instead of reference, I replace :

$orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0], null) , 'selected' => (int)$this->getOrder() == $order->id);

by

$orders[] = array('value' => $order->id, 'label' => $order->id.' - '.Tools::displayDate($date[0], null) , 'selected' => (int)$this->getOrder() == $order->id);

And the mail templates :

'{order_name}' => $order->getUniqReference(),

By

'{order_name}' => (int)$order->id,

And all is ok.

Link to comment
Share on other sites

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