VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: melina on May 14, 2012, 14:10:07 PM

Title: Template for order emails!
Post by: melina on May 14, 2012, 14:10:07 PM
After a lot of time of wanting to give something instead of asking, I finally found something I can give to you!

Many of you, just like me, must be wondering how and where to change the templates for the emails sent to the users when after ordering our roducts.

After A LOT of work, research and trying out things with no results, I found it!

Let me tell you, it is amazing to have something like Joomla and Virtuemart and I love what they do. But was that hard to explain this kind of changes somewhere? I could find it anywhere... little explanation... nothing.

Ok, when you want to change the emails, the first thing you have to know is that iit is nothing like the old VM. This time you have your emails put together with different files. Header, footer, content... all separarted. That means you have to find and edit all of the files.

As usual, the text on emails are taken from the language files, so you can look for that there and change it as you wish.

Regarding the rest, I cant help with everything but at least I can tell you what I found out to help. You have to go to components/com_virtuemart/views/invoice/tmpl
Over there you will find:
mail_html.php for the genral rules of the email (background color, for example)
mail_html_header.php
mail_html_footer.php
mail_html_shopper.php (this is the one for the order number, etc)
mail_html_shopperaddresses.php (this is the one for the block with the 2 addresses information)
mail_html_vendor.php (for the vendor email, the one you get)
mail_html_invoice_items.php (this is the one for the table with all the items, sku, prices, etc)

Hope to help in some way to someone!!
=)
Title: Re: Template for order emails!
Post by: Stannite on May 15, 2012, 11:49:57 AM
Thanks for the info, it saves me some time to figure it out myself.
Title: Re: Template for order emails!
Post by: melina on May 21, 2012, 20:13:10 PM
Your are welocme! That was my idea, to save some time to others...  :D
Title: Re: Template for order emails!
Post by: celticwebs on May 22, 2012, 23:06:05 PM
Thanks for the tip,  I've been trying to find what tells the system the order to print out the address.  I'd like it to be city, state, zip  but currently I think it's state zip city which the postal machine doesn't recognize.   Does anybody know where the address order layout is set please?
Title: Re: Template for order emails!
Post by: melina on May 22, 2012, 23:53:00 PM
Hi Celticwebs! If I am not mistaken the address shown on the email correspon to the user fields on BE. I think the order you give to the fields on BE of VM is the order to show the fields everywhere, the account, the email, etc. Try changing the order of fields there.
=)
Title: Re: Template for order emails!
Post by: zanardi on September 03, 2012, 17:16:06 PM
Thank you @melina. To complete the information, the SUBJECT of the e-mail can be changed in the language file. The strings are around line 222-244 of the frontend language file.
Title: Re: Template for order emails!
Post by: Bit Stupid on May 13, 2013, 18:19:05 PM
Just an update to this super useful post.

mail_html_invoice_items.php (this is the one for the table with all the items, sku, prices, etc)

No it is currently just invoice_items.php

also you seem to need to edit the core files, editing them in any kind of template override (for me) did not work.  So I do not know how stable these updates will be when updating Virtuemart? (any dev coments to this welcome??)

Also for the subject line - This is controlled through the Language files.
Title: Re: Template for order emails!
Post by: wnrdesign on May 20, 2013, 23:42:33 PM
Hi,

Thanks for this, I've already found the user e-mail templates as well myself.

What I need to change is the order confirmation send to the vendor. Does anyone know where to edit those files?

Kind regards.
Title: Re: Template for order emails!
Post by: maxispin on September 18, 2013, 21:09:30 PM
Thanks Melina!
Title: Re: Template for order emails!
Post by: skhn123 on April 14, 2014, 07:32:29 AM
Thank you so much melina for this useful info.

Sadique Khan
Title: Re: Template for order emails!
Post by: FelixR on April 25, 2014, 14:17:58 PM
Thanks for this

However - my emails include all the text that is in the shop description.

Cannot see where/how to remove that
Title: Re: Template for order emails!
Post by: jenkinhill on April 25, 2014, 18:01:07 PM
In the Shop/Invice/Email tab remove {vm:vendorlegalinfo} from the footer field editor.
Title: Re: Template for order emails!
Post by: decorette on July 15, 2015, 08:23:54 AM
Quote from: melina on May 14, 2012, 14:10:07 PM
After a lot of time of wanting to give something instead of asking, I finally found something I can give to you!

Many of you, just like me, must be wondering how and where to change the templates for the emails sent to the users when after ordering our roducts.

After A LOT of work, research and trying out things with no results, I found it!

Let me tell you, it is amazing to have something like Joomla and Virtuemart and I love what they do. But was that hard to explain this kind of changes somewhere? I could find it anywhere... little explanation... nothing.

Ok, when you want to change the emails, the first thing you have to know is that iit is nothing like the old VM. This time you have your emails put together with different files. Header, footer, content... all separarted. That means you have to find and edit all of the files.

As usual, the text on emails are taken from the language files, so you can look for that there and change it as you wish.

Regarding the rest, I cant help with everything but at least I can tell you what I found out to help. You have to go to components/com_virtuemart/views/invoice/tmpl
Over there you will find:
mail_html.php for the genral rules of the email (background color, for example)
mail_html_header.php
mail_html_footer.php
mail_html_shopper.php (this is the one for the order number, etc)
mail_html_shopperaddresses.php (this is the one for the block with the 2 addresses information)
mail_html_vendor.php (for the vendor email, the one you get)
mail_html_invoice_items.php (this is the one for the table with all the items, sku, prices, etc)

Hope to help in some way to someone!!
=)


There used to be an order_confirmation_email file to edit the language for emails sent to customers... I can't find that file now on the new virtuemart... can someone direct me to the correct language files? Thank you!

VM 2.0.20b
Joomla 2.5.19
Title: Re: Template for order emails!
Post by: jenkinhill on July 15, 2015, 10:49:39 AM
Quote from: decorette on July 15, 2015, 08:23:54 AM
I can't find that file now on the new virtuemart...
Quote
VM 2.0.20b
Joomla 2.5.19

Those versions are not new, but old and insecure. What "new" version are you referring to?
Title: Re: Template for order emails!
Post by: decorette on July 15, 2015, 11:07:41 AM
I'm sorry I wasn't clear. I'm using those versions (VM 2.0.20b) and am unable to find the order confirmation email language file since upgrading to version 2... appreciate your help!
Title: Re: Template for order emails!
Post by: decorette on July 15, 2015, 13:06:28 PM
Or maybe someone can point me in the direction of where to amend the language files in VM 2.0.20b that would be great! Am handing the site over to someone else to handle but need to amend the files before doing so... thanks a million!
Title: Re: Template for order emails!
Post by: jenkinhill on July 15, 2015, 18:32:49 PM
In the current VM2 version, 2.6.18 the template files are slightly changed from those described in http://forum.virtuemart.net/index.php?topic=102633.msg340711#msg340711  but easy to work with.

To change language strings see the FAQ:  http://forum.virtuemart.net/index.php?topic=113895.0

If you are passing the site to someone else you had better advise them that the J&VM versions used are old and have known critical security issues (ie should not be used on a live site).  See http://forum.virtuemart.net/index.php?topic=118683.0
Title: Re: Template for order emails!
Post by: Malko on October 07, 2016, 11:34:35 AM
Where can I find the mentioned files for email template customization in VirtueMart 3.0.17?
Title: Re: Template for order emails!
Post by: jenkinhill on October 07, 2016, 12:09:57 PM
In the same place!   components/com_virtuemart/views/invoice/tmpl/  unless you already use template overrides.
Title: Re: Template for order emails!
Post by: Dragoner on October 11, 2016, 13:21:18 PM
Is possilble show preview of html/raw emails in URL?

Thanks
David
Title: Re: Template for order emails!
Post by: GJC Web Design on October 11, 2016, 16:14:08 PM
just add die(); at the bottom of the default.php and change an order ststus
Title: Re: Template for order emails!
Post by: Dragoner on November 02, 2016, 11:22:14 AM
Hello, please in which defaut.php?

In folder 1:/www/components/com_virtuemart/views/invoice/tmpl/

I haven't this file.

Thanks
David
Title: Re: Template for order emails!
Post by: GJC Web Design on November 02, 2016, 15:05:25 PM
components\com_virtuemart\views\invoice\tmpl\mail_html.php
Title: Re: Template for order emails!
Post by: FlyingMarkus on August 02, 2021, 15:03:31 PM
Hello,

i want to change the email template too. But i want change the email title for customer via language file. Where can i fand that?

My versions:
Joomla 3.9.20
VirtueMart 3.8.4

have a nice week,
Markus
Title: Re: Template for order emails!
Post by: Studio 42 on August 03, 2021, 13:13:54 PM
The subject for orders use Joomla language KEY.
Search for  COM_VIRTUEMART_MAIL_SUBJ_ and the order letter at end.
For eg COM_VIRTUEMART_MAIL_SUBJ_C for confirmation email.
Note that you have perhaps to override the back-end too, when you update an order statut as shop manager in back-end