Author Topic: Template override not working for order emails  (Read 3498 times)

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Template override not working for order emails
« 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/ :(
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: Template override not working for order emails
« Reply #1 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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Template override not working for order emails
« Reply #2 on: October 27, 2012, 17:07:31 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
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: Template override not working for order emails
« Reply #3 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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Template override not working for order emails
« Reply #4 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.
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: Template override not working for order emails
« Reply #5 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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Template override not working for order emails
« Reply #6 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.
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Template override not working for order emails
« Reply #7 on: October 31, 2012, 12:22:22 pm »
Hmm, no thats not it, the same template is used for both cases.
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: Template override not working for order emails
« Reply #8 on: October 31, 2012, 20:05:31 pm »
ok, give me some time to take a better look
Regards
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

almoravit

  • Beginner
  • *
  • Posts: 12
    • EConceptes SCP
Re: Template override not working for order emails
« Reply #9 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
Regards!

PRO

  • Global Moderator
  • Super Hero
  • *
  • Posts: 10404
  • VirtueMart Version: 3+
Re: Template override not working for order emails
« Reply #10 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

J3.9+ VM 3.4.2
Slowest Page Speed Score (88) (Category)
Fastest Page Speed Score (94-96) (productdetails)

almoravit

  • Beginner
  • *
  • Posts: 12
    • EConceptes SCP
Re: Template override not working for order emails
« Reply #11 on: November 01, 2012, 23:06:07 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.

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: Template override not working for order emails
« Reply #12 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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

almoravit

  • Beginner
  • *
  • Posts: 12
    • EConceptes SCP
Re: Template override not working for order emails
« Reply #13 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!

bytelord

  • Nikos
  • Global Moderator
  • Full Member
  • *
  • Posts: 2369
Re: Template override not working for order emails
« Reply #14 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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!