VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Jason Farmer on October 24, 2012, 13:26:54 PM

Title: Template override not working for order emails
Post by: Jason Farmer on October 24, 2012, 13:26:54 PM
Created a new file .../templates/<default template>/html/com_virtuemart/invoices/mail_html_shopper.php

but its not getting picked up... so had to change core file in .../components/com_virtuemart/views/invoices/tmpl/ :(
Title: Re: Template override not working for order emails
Post by: bytelord on October 24, 2012, 15:34:41 PM
Hi,

the right path should be /templates/<your_joomla_template>/html/com_virtuemart/invoices/mail_html_shopper.php

vm and joomla versions?

Regards
Title: Re: Template override not working for order emails
Post by: Jason Farmer on October 27, 2012, 17:07:31 PM
Quote from: bytelord on October 24, 2012, 15:34:41 PM
Hi,

the right path should be /templates/<your_joomla_template>/html/com_virtuemart/invoices/mail_html_shopper.php

vm and joomla versions?

Regards

I have the right path - same as the one you posted.
vm & joomla versions as per signature : vm 2.012b J 2.5.6
Title: Re: Template override not working for order emails
Post by: bytelord on October 27, 2012, 20:30:27 PM
Hello,

You said <default template> for that reason i said <your_joomla_template>, working for me, have you select other template override from the vm backend configuration?

Regards
Title: Re: Template override not working for order emails
Post by: Jason Farmer on October 27, 2012, 22:45:39 PM
Ah I see , thank you for the clarification.

Yes, I have several vm template overrides are working, just this one that isn't.
Title: Re: Template override not working for order emails
Post by: bytelord on October 29, 2012, 14:24:07 PM
Hi,

This one is when customers confirm the order ... am i right?
So that template will be used when customer confirm the order (order status  Confirmed by shopper - U).

Regards
Title: Re: Template override not working for order emails
Post by: Jason Farmer on October 31, 2012, 12:17:46 PM
Its used when the order is set to confirmed C in the admin area...
and that's probably where I'm going wrong. I'll create a template override on the admin side.

Thank you.
Title: Re: Template override not working for order emails
Post by: Jason Farmer on October 31, 2012, 12:22:22 PM
Hmm, no thats not it, the same template is used for both cases.
Title: Re: Template override not working for order emails
Post by: bytelord on October 31, 2012, 20:05:31 PM
ok, give me some time to take a better look
Regards
Title: Re: Template override not working for order emails
Post by: almoravit on November 01, 2012, 21:36:48 PM
Hi,
I have a similar problem (maybe the same) with VM 2.0.12f and Joomla!v2.5.7
All template overrides are working perfectly except the pdf attached in email when an order is confirmed, which instead of using the overrided files is using the component files. However, when I use the create invoice button in backend it uses the overrided files as it is supposed to do.
By the moment I will try this temporary patch https://forum.virtuemart.net/index.php?topic=100543.0 (https://forum.virtuemart.net/index.php?topic=100543.0)
Regards!
Title: Re: Template override not working for order emails
Post by: PRO on November 01, 2012, 22:18:26 PM
the order emails used to be sent from another file in earlier versions of vmart 2.0

Make sure those OLD files are not still there

Title: Re: Template override not working for order emails
Post by: almoravit on November 01, 2012, 23:06:07 PM
Quote from: PRO on November 01, 2012, 22:18:26 PM
the order emails used to be sent from another file in earlier versions of vmart 2.0

Make sure those OLD files are not still there
Hi PRO,
Which files should I check for?
Thanks in advance.
Title: Re: Template override not working for order emails
Post by: bytelord on November 02, 2012, 12:28:03 PM
Hello,

mail_html_shopper.php is used and is for the customer orders ... i test it and works just fine. So there is no issue with that.
the other you could check is from the backend if you have configured your mail send as html or raw... because if raw enabled then the file is mail_raw_shopper.php

I think you placed on the wrong place ... i have to say it again, the right path is /templates/<your_joomla_template_you_use>/html/com_virtuemart/invoices/mail_html_shopper.php

Regards
Title: Re: Template override not working for order emails
Post by: almoravit on November 02, 2012, 21:47:46 PM
Hi bytelord,

first thanks for your help :)
Email is set to HTML.
I have the issue with invoice*.php, but only when the order status is changed to any state which will send the email. In that case the attached PDF is created using the /components/com_virtuemart/views/invoice files instead of being created using /templates/the_template_I_use/html/com_virtuemart/invoice files.
Curiosly if I push the 'Invoice' button on the backend orders list (under the big printer icon) the override is working perfectly.

Again, thanks!
Title: Re: Template override not working for order emails
Post by: bytelord on November 03, 2012, 16:52:22 PM
Hi,

When you click the pdf button from the be the url is /index.php?option=com_virtuemart&view=invoice&layout=invoice&format=pdf&tmpl=component&virtuemart_order_id=9&order_number=xxxxxxx&order_pass=xxxxxx
So, the PDF view is been regenerated for an existing order...but

When order is been placed for first time and status changed to the preferred status that send the pdf invoice, pdf generation take place ... when you resend that mails ... just resend the file located under {safe_path}\{vmfiles}\invoices\xxxx.pdf
So, if you make your changes inside your template and try to "play" with an already existing order just resend the file under {safe_path}\{vmfiles}\invoices\xxxx.pdf ... so there is no regeneation ... try to place a new order or delete the file for testing purposes in a testing installation to be regenerated.

Not sure if am right, but please test.

Regarsd
Title: Re: Template override not working for order emails
Post by: almoravit on November 05, 2012, 16:46:16 PM
Hi,
I've just tried you suggestions but no luck :(
First, I've restored the original invoice template files (I've modified them before) and I did a new order. The confirmation email was build perfectly but when I changed the order status I received an email with the right body but with the wrong PDF format.

Thanks!
Title: Re: Template override not working for order emails
Post by: bytelord on November 21, 2012, 18:56:00 PM
Take a look over here: http://forum.virtuemart.net/index.php?topic=100543.0;topicseen
Title: Re: Template override not working for order emails
Post by: almoravit on November 24, 2012, 18:05:30 PM
Thanks for the link. I've tried that and now its ok.

Regards!