Jump to content

How to change date order on shop emails?


flix

Recommended Posts

I'd like to alter the date structure in order order confirmation mails that go to custimers, and the confirmations that shop employees receive.

 

At the moment, they're in the format: 2011-12-16

 

I'd like them to look like this instead: 16-12-20011

 

In order order_conf.html in the mail folder and neworder.html in the mailalerts folder, it looks like it's {date} that's determining the format, but does anyone have any idea how to alter this?

Link to comment
Share on other sites

You would have to edit the classes/PaymentModule.php file. The following code formats the date using 'Y-m-d H:i:s'

 

'{date}' => Tools::displayDate(date('Y-m-d H:i:s'), (int)($order->id_lang), 1),

 

You can use this URL for a reference on date formatting options

http://php.net/manual/en/function.date.php

 

This should be what you want

'{date}' => Tools::displayDate(date('d-m-Y H:i:s'), (int)($order->id_lang), 1),

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

Thanks for your reply.

I changed the date display line in PaymentModule.php just as you described, but it hasn't changed the date orde, so it's a bit of a puzzle. Are you sure the date order in paymentmodule.php relates to shop emails?

Link to comment
Share on other sites

the mail that goes to employees is from the mailalerts module. this appears to use the language configured date format. if you are using v1.4.6.2, then go into the backoffice, and edit your language to revise the date format.

 

Note: This will change the date format for the entire store for that language.

 

If you only want to change the date in the mailalerts, then you will have to revise the module to not use the Tools::displayDate function

Link to comment
Share on other sites

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