VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: sscheidegger on February 29, 2012, 18:05:33 PM

Title: Override of confirmation mails
Post by: sscheidegger on February 29, 2012, 18:05:33 PM
Hey,

since I updated to VM 2.0.2 I cannot use template overrides for the order confirmation emails anymore! I saw that the files have been moved to a new directory "invoice". However, when I create overrides for these emails in a new invoice folder in my template, nothing changes!

Any suggestions what could I be doing wrong?
Title: Re: Override of confirmation mails
Post by: PRO on February 29, 2012, 21:52:22 PM
it should work, are you using the right filenames?

Title: Re: Override of confirmation mails
Post by: butchtones on February 29, 2012, 22:05:36 PM
... okay I know this is a bit off topic but how do you do a Template Override?  I've been trying to figure it out.  I'm on 2.0.2.

Thanks!
Title: Re: Override of confirmation mails
Post by: Milbo on February 29, 2012, 22:40:50 PM
Quote from: butchtones on February 29, 2012, 22:05:36 PM
... okay I know this is a bit off topic but how do you do a Template Override?  I've been trying to figure it out.  I'm on 2.0.2.

Thanks!

http://bit.ly/x80NGM
Title: Re: Override of confirmation mails
Post by: sscheidegger on March 01, 2012, 09:57:12 AM
Milbo, I didn't know LMGTFY yet, nice one :D

But what about the email overrides, that don't work? (I just tested it also in a clean installation of VM202 an J251.) Could you also google this for me?
Title: Re: Override of confirmation mails
Post by: marcodelpercio on March 02, 2012, 16:33:45 PM
I have the same problem. I had VM 2.0.0 and I had coded email override in the "html" folder of my template and they were working perfectly, then updated to 2.0.2 and they don't work anymore. In particular I am referring to the reguser email.

Could you please verify or confirm us the correct path/filename?
Title: Re: Override of confirmation mails
Post by: marcodelpercio on March 03, 2012, 12:22:00 PM
I confirm I have the sam issue also on order confirmation emails:
I tried both  html/com_virtuemart/cart/mail_*   and   html/com_virtuemart/invoice/mail_* but always the same result. I just get default email without override.
Am I wrong? I don't think so since apart from emails the other overrides work properly.
Title: Re: Override of confirmation mails
Post by: Milbo on March 03, 2012, 12:51:18 PM
Yeh, I was reading this http://forum.virtuemart.net/index.php?topic=98972.msg326715#msg326715 and then I understood the problem.

In fact there is no problem, the invoice and the confirmation mail are just now using always the FE view invoice. Updates do not delete old files, so you got tricked. :-)

I think very interesting is for a lot people, that you can style this stuff without sending an email all the time, just use
http://localhost/.../en/?option=com_virtuemart&view=invoice&layout=invoice&tmpl=component&order_number=XXX&order_pass=p_yyy for the mail and
http://localhost/.../en/?option=com_virtuemart&view=invoice&layout=invoice&tmpl=component&order_number=XXX&order_pass=p_yyy&format=pdf for the pdf

Of course you must set for xxx and yyy your order_number and order_pass
Title: Re: Override of confirmation mails
Post by: marcodelpercio on March 03, 2012, 18:56:53 PM
Thank you for replying

however I suppose I'm not understanding or we're not understanding each other... I already "guessed" that Virtuemart was using "invoice" view instead of "cart" view and I thank you so much for the dynamic url to provide on the fly the layout to use... however I am talking about template override and from what I see template override doesn't work anymore for those views whatever I try to override (user/cart/invoice).

The Virtuemart email is fine for content but I want to override it in my template and until a few days ago (before 2.0.2) I was able to do that with view override in my template. Now it doesn't work anymore. I hope that now the problem is more clear. Is that a bug? Am I overriding the wrong view? The wrong path? What?

Thanks in advance
Title: Re: Override of confirmation mails
Post by: sscheidegger on March 05, 2012, 09:16:46 AM
Hi Milbo

Thanks a lot for the hint with the link to show the email!

I'm also a little bit confused by your answer. Why do you think that there is no problem? I'll try to explain better:
1. The layout of the order confirmation emails is generated using the files in components/com_virtuemart/views/invoice/tmpl, namely the files mail_html.php, mail_html_footer.php, mail_html_header.php, mail_html_pricelist.php, mail_html_shopper.php and mail_html_shopperaddresses.php.
2. I can confirm that these files are being used. If I do changes in one of them, they show in the order confirmation emails.
3. Every Joomla user knows, that he shouldn't do changes in the components folder but use template overrides.
4. I copied the files named above to the folder templates/mytemplate/html/com_virtuemart/invoice/.
5. Whatever changes I do in these files, they don't show in order confirmation emails.
6. Changes I do to the original files in the folder components/com_virtuemart/views/invoice/tmpl still have an effect on the order confirmation emails.
7. Therefore I'm sure that Joomla/VM are using the view files in the components folder for order confirmation emails even tough override files in my template folder exist.
8. Therefore I conclude that either there is a problem or my override files are in the wrong folder (which I doublechecked many times)

Don't you agree on this?

Furthermore:
1. I'm working on Joomla/VM system that has lived many updates and developer versions.
2. When I face a new problem, I assume that it is caused by incorrect updates.
3. Therefore I use a second clean installation of the current version of Joomla and VM.
4. The problem described above is exactly the same on that second system of mine.
5. Therefore I conclude that it must be a problem of the new VM version.

Thanks for having a look at this again!
Title: Re: Override of confirmation mails
Post by: marcodelpercio on March 06, 2012, 11:54:43 AM
Exactly! Precisely sscheidegger! That's absolutely the same problem I am experiencing! And that's exactly the same thing I tried to explain.
I am quite sure that VM update 2.0.2 introduced such issue.
Title: Re: Override of confirmation mails
Post by: riverhawk on March 08, 2012, 08:31:15 AM
Any solution yet? Have the same problem. I can override views such as 'cart', 'category', and 'user'...but when I try 'invoice' it doesn't seem to work. JM2.5 and VM 2.0.2.
Title: Re: Override of confirmation mails
Post by: Milbo on March 08, 2012, 10:59:29 AM
So the mail is using the right layouts in FE, you can make changes in the Core and you see em. But when you want to use the standard overwrite method it is not working?

HMMM ! hmpf, shit. I dont have a clue atm.
Title: Re: Override of confirmation mails
Post by: PRO on March 08, 2012, 12:59:26 PM
some files moved from one folder to another.

MAKE sure the OLD files are not in the old folder.

YOU can unzip an install package, and then re-name your views foldr.

THEN, replace it with the new "views" folder.

Title: Re: Override of confirmation mails
Post by: ZX81 on March 11, 2012, 19:13:29 PM
Quotesome files moved from one folder to another.

MAKE sure the OLD files are not in the old folder.

YOU can unzip an install package, and then re-name your views foldr.

THEN, replace it with the new "views" folder.

Joomla! 2.5.1/VM2.0.2

Hi Banquet, I did this but the override still doesn't work. The only way I can override is by modifying the files directly in the view/tmpl folder. Is there another way around this or is it fixed in 2.0.3?

ZX
Title: Re: Override of confirmation mails
Post by: Thomas Kuschel on March 13, 2012, 16:56:28 PM
Hi,
I put the views to the invoice into my joomla template, but it didn't work too. (/template/mytemplate/html/com_virtuemart/invoice/*.php); all other com_virutuemart views did work
So, after debugging, I found out that within the function "renderMail" the origin path to the /view/$viewName/tmpl/ is added as LIFO, even though the path already exists!!! -  so the template path wasn't found any more.

I have commented out the line 180 in /components/com_virtuemart/helpers/shopfunctionsf.php (line 180):
//Todo, do we need that? refering to http://forum.virtuemart.net/index.php?topic=96318.msg317277#msg317277
//TK 20120309 LOYTEC patch next line: we do not need the template loaded - because of LIFO, the default user template is overwritten.
//$view->addTemplatePath(JPATH_VM_SITE.'/views/'.$viewName.'/tmpl');


Please check this out! -
now it works for me, and I can change all the invoice - mail stuff in my template!

Thomas Kuschel
Title: Re: Override of confirmation mails
Post by: Milbo on March 14, 2012, 19:39:51 PM
I fixed in C version
Title: Re: Override of confirmation mails
Post by: ZX81 on March 15, 2012, 23:37:08 PM
Great news! Thank you very much.
Title: Re: Override of confirmation mails
Post by: maxispin on March 23, 2012, 06:25:17 AM
Quote from: tkuschel on March 13, 2012, 16:56:28 PM
now it works for me, and I can change all the invoice - mail stuff in my template!

Thanks Thomas!  and also Sscheidegger in page 1 !!

Milbo,
The problem what still exists is that the status update and invoice email are the same. They should be two different things. Please separate them.


I tried to figure out a if-clause in mail.html.php without success  :( - skills just aren't nearly there.. (e.g., order already exists, do not print pricelist)


// render price list
         
foreach ($this->orders['fields'] as $field) {
        if ($field['value'] < 0 ) {
echo $this->loadTemplate('pricelist');
}}
Title: Re: Override of confirmation mails
Post by: Lexiboy on March 27, 2012, 00:28:23 AM
Quote from: tkuschel on March 13, 2012, 16:56:28 PM
Hi,
I put the views to the invoice into my joomla template, but it didn't work too. (/template/mytemplate/html/com_virtuemart/invoice/*.php); all other com_virutuemart views did work
So, after debugging, I found out that within the function "renderMail" the origin path to the /view/$viewName/tmpl/ is added as LIFO, even though the path already exists!!! -  so the template path wasn't found any more.

I have commented out the line 180 in /components/com_virtuemart/helpers/shopfunctionsf.php (line 180):
//Todo, do we need that? refering to http://forum.virtuemart.net/index.php?topic=96318.msg317277#msg317277
//TK 20120309 LOYTEC patch next line: we do not need the template loaded - because of LIFO, the default user template is overwritten.
//$view->addTemplatePath(JPATH_VM_SITE.'/views/'.$viewName.'/tmpl');


Please check this out! -
now it works for me, and I can change all the invoice - mail stuff in my template!

Thomas Kuschel

After commenting this out the new order notifications use the templates in /templates/...., which is great.

But when I update an order's status and Joomla wants to send the mail of order status change it complains it cannot find the mail_html view... What to do...
Title: Re: Override of confirmation mails
Post by: baroen on May 16, 2012, 22:22:32 PM
I am having the same problem. Being on v2.0.6 I took the original invoice files, modified them and saved them in my template/html/invoice folder. When generating an invoice VM still uses the original layout. I tried to comment out the '180' line, but that did not work either. How can I get VM to use my own invoice layout? Any solutions yet?
Title: Re: Override of confirmation mails
Post by: Thomas Kuschel on May 31, 2012, 21:55:28 PM
With VM 2.0.6 this behavior is already fixed. Be careful to copy the right files/directories!
I copied only the files mail_html.php, mail_html_footer.php, mail_html_header.php, mail_html_pricelist.php, mail_html_shopper.php, mail_html_shopperaddresses.php, mail_html_vendor.php, and the index.html into the folder
templates/<mytemplate>/html/com_virtuemart/invoice/
The mailing (Order Mail Format) was configured to "HTML Mail".
It does work!

Thomas
http://www.loytec.com
Title: Re: Override of confirmation mails
Post by: reinhold on November 21, 2012, 19:19:25 PM
This line is needed in the invoice.php controller when the pdf invoice is automatically created (i.e. when VirtueMartControllerInvoice::checkStoreInvoice creates the pdf), because there the whole virtuemart path environment doesn't seem to be set up properly. And this does not appear to be fixed in Virtuemart 2.0.12f.

If you view the invoice pdf in the backend by clicking on the invoice icon, then a completely different codepath is used to create the pdf (joomla's pdf generation functionality, together with the invoice/mail_html view template.
If the order status is changed to a value configured to auto-generate and send the invoice, then

Basically, the templates used are:

-) notification mail body: mail_html.php
-) pdf invoice in the "order" list in the BE (click on the pdf icon): invoice.php
-) print invoice in the "order" list in the BE (click on the print icon): invoice.php (but no header/footer!)
-) auto-generated pdf invoice mail body (change the order status to confirmed): mail_html.php (but NO language override)
-) auto-generated pdf invoice mail attachment (change the order status to confirmed): invoice.php (but NO language override)

So, to me it seems like the invoice generation uses different codepathes and different templates, which might run you into legal trouble, if you forget to modify one template. Then a different invoice might be mailed out to the customer than you print out for your own bookkeeping in the backend!

Title: Re: Override of confirmation mails
Post by: randomdev on December 17, 2012, 03:25:02 AM
Quote from: reinhold on November 21, 2012, 19:19:25 PM
This line is needed in the invoice.php controller when the pdf invoice is automatically created (i.e. when VirtueMartControllerInvoice::checkStoreInvoice creates the pdf), because there the whole virtuemart path environment doesn't seem to be set up properly. And this does not appear to be fixed in Virtuemart 2.0.12f.

So, to me it seems like the invoice generation uses different codepathes and different templates, which might run you into legal trouble, if you forget to modify one template. Then a different invoice might be mailed out to the customer than you print out for your own bookkeeping in the backend!

I may have missed it but I cannot see the line you are talking about for invoice.php?

I have made an override for invoice_items.php which I thought invoice.php was using for the pdf attachment to customer but I am getting a layout with a discount column that I had removed?

Is it the case that the pdf attachment to the customer is simply not using the overrides? (I am using vm 2.0.14)
Title: Re: Override of confirmation mails
Post by: Milbo on December 17, 2012, 11:45:20 AM
Quote from: reinhold on November 21, 2012, 19:19:25 PM
If you view the invoice pdf in the backend by clicking on the invoice icon, then a completely different codepath is used to create the pdf (joomla's pdf generation functionality, together with the invoice/mail_html view template.
...
So, to me it seems like the invoice generation uses different codepathes and different templates, which might run you into legal trouble, if you forget to modify one template. Then a different invoice might be mailed out to the customer than you print out for your own bookkeeping in the backend!


Completly wrong! ! !

The path for the invoice/order print in the BE is "https://yourdomain.com/index.php?option=com_virtuemart&view=invoice&layout=invoice&tmpl=component&virtuemart_order_id=16&order_number=6e2e018&order_pass=p_6f8d5"

Clearly to see that it is pointing to the FE. There is NO invoice/order or any mail layout in the BE. You can override all with the FE template. Also a thread I should have deleted, because you answer to a problem which was solved in 2.0.6

Maybe you have old layouts of an old version there, but there is NO file with "invoice" in the name in the whole BE, it does not exist.
Title: Re: Override of confirmation mails
Post by: neo314 on December 19, 2012, 23:34:07 PM
Quote from: Milbo on December 17, 2012, 11:45:20 AM
Quote from: reinhold on November 21, 2012, 19:19:25 PM
If you view the invoice pdf in the backend by clicking on the invoice icon, then a completely different codepath is used to create the pdf (joomla's pdf generation functionality, [snip]
Completly wrong! ! !

[snip]

Maybe you have old layouts of an old version there, but there is NO file with "invoice" in the name in the whole BE, it does not exist.

Hi Milbo,

I don't think he was saying the file was in the BE. I think he was just identifying which file the BE pdf link was using, and as discussed in the other thread, the PDF files are different, so something is different.

I appreciate how many questions that seem to already be answered are asked again and how many users may be off base on how VM works. I really appreciate all the work you have put into this. At the same time, this invoice issue is a serious matter, and your responses on this subject, at times, seem defensive, dismissive, and abrupt. I don't think people are complaining. We just want to figure this out.
Title: Re: Override of confirmation mails
Post by: Milbo on December 19, 2012, 23:46:55 PM
I just explained it reinhold 2 days ago.

Joomla stopped pdf support. So we just take the same library (but updated) and install it with the aio at the same place. To create a pdf out of a product view or similar, we use the joomla pattern which is just using view.pdf.php instead of the view.html.php.

But then we cannot store it on the disc, what we need to send it per email. That is the reason that it is slightly different. But usually a store is using only email, or only print. Therefore it is usually not a problem.

Furthermore for the state it is unimportant, so it s a cosmetic problem. Then ask your users if they even noticed the difference between the pdf of the mail and the printed invoice. Of course, we are happy if someone is enhancing it.
Title: Re: Override of confirmation mails
Post by: neo314 on December 20, 2012, 00:33:19 AM
Quote from: Milbo on December 19, 2012, 23:46:55 PM
I just explained it reinhold 2 days ago.

Joomla stopped pdf support. So we just take the same library (but updated) and install it with the aio at the same place. To create a pdf out of a product view or similar, we use the joomla pattern which is just using view.pdf.php instead of the view.html.php.

But then we cannot store it on the disc, what we need to send it per email. That is the reason that it is slightly different. But usually a store is using only email, or only print. Therefore it is usually not a problem.

Furthermore for the state it is unimportant, so it s a cosmetic problem. Then ask your users if they even noticed the difference between the pdf of the mail and the printed invoice. Of course, we are happy if someone is enhancing it.

Hi Milbo,

I have followed the dialog, unless there is a thread I have not found yet on this subject, and I believe I understand what you are explaining.

I disagree that this is merely a cosmetic problem, but if that were the case, a cosmetic problem like this is still a problem. It is like having a crappy business card.

I don't think it is purely cosmetic either. The Email that I get from the purchase is something I can override, and even without doing an override, it is not coming from the same source as the attached PDF file. The email has clean formatting with order information at the top and the Bill To/ Ship To list the information cleanly with out the array's keys spit out.

The pdf attached to the email and the pdf shown in the back end, may share a source file, but template overrides appear in the BE pdf and not in the email attachment pdf, and on mine, the head of the two files is different along with added information (Order Status Table) included in the email attachment (See attached images).

I need to be able to get control of this layout to move forward. If the email does not match the pdf, I at least need to be able to make the BE pdf and the email attachment pdf match. If I can't do that, as a last resort, I need to at least be able to stop the email attachment from going out (just the email, no attachment).





[attachment cleanup by admin]
Title: Re: Override of confirmation mails
Post by: neo314 on December 20, 2012, 02:05:46 AM
For anyone this may help, this thread provided me my last resort solution. http://forum.virtuemart.net/index.php?topic=110099.0 (http://forum.virtuemart.net/index.php?topic=110099.0)

I would like to be able to attach a decent pdf invoice for the customer, but until that is possible, the email will have to do.

As a feature request, should the override/styling capability for the email pdf attachment issue get resolved, it would be nice if the filename prefix were configureable so that instead of vminvoice_ it could be MyStoreInvoice_ and even better if I could configure the pattern so I could get MyStoreInvoice_12-19-2012_[order number] or whatever.

Something like this in the BE configuration (| xxx | represents what would be inside the input field):

Invoice Prefix: | vminvoice_ | [default]
Invoice Number Date Format: | ymd | Hint: code for PHP date function date("ymd") [default]

(P.S. I saw that it looks like that is not how you are getting the date format so I don't know what would work better. That is just supposed to be what would be included in the php date function for output)
Title: Re: Override of confirmation mails
Post by: randomdev on December 20, 2012, 02:31:03 AM
If you want to change it I believe the filename is in controllers/invoice.php line 88 (I haven't tested this)

$path .= 'vminvoice_'.$invoiceNumber.'.pdf';
Title: Re: Override of confirmation mails
Post by: neo314 on December 20, 2012, 02:38:01 AM
Quote from: randomdev on December 20, 2012, 02:31:03 AM
If you want to change it I believe the filename is in controllers/invoice.php line 88 (I haven't tested this)

$path .= 'vminvoice_'.$invoiceNumber.'.pdf';

Thanks. I found that, but it would be nice if it were configurable so the changes would survive updates. Also, it doesn't matter if I can't get the PDF to look half way decent, so I just made it not attach a pdf to the email at all for now.
Title: Re: Override of confirmation mails
Post by: randomdev on December 20, 2012, 02:46:49 AM
I could get the pdf in the emails looking ok, but I am having problems with the BE pdf one however (tiny logo and lots of spacing).

The store owner wanted to use this to print out and attach to the parcels (the print view is even worse and looks like it has no formatting/css?)
Title: Re: Override of confirmation mails
Post by: Milbo on December 20, 2012, 12:35:21 PM
Quote from: neo314 on December 20, 2012, 00:33:19 AM
I don't think it is purely cosmetic either. The Email that I get from the purchase is something I can override, and even without doing an override, it is not coming from the same source as the attached PDF file.
It cannot be the same, of course the email is different than an invoice. But exactly the same is the price list. We just use always the same file for it.

But the pdf of the email and the pdf created in the Backend are exactly the same except two small things. The header and the footer of the pdf is not exactly the same. This is the reason for the different size of logos.
One time we use /index.php?option=com_virtuemart&view=invoice&layout=invoice&format=pdf&tmpl=component&virtuemart_order_id=xxx&order_number=1234&order_pass=yyy

This is using then "/libraries/joomla/document/pdf/pdf.php". But the pdf of the email is created in the controller and we change the headers there. Reinhold meant at begin that he is eager to solve it, but then also said, uih shit, that looks hard. I spent already 4-5 hours to get it running. So we are happy if someone has an idea, how we can overwrite the header and footer and how we can have always the same thing. yes. Adding of new fonts is already in vm2.1.

Quote from: neo314 on December 20, 2012, 00:33:19 AM
The email has clean formatting with order information at the top and the Bill To/ Ship To list the information cleanly with out the array's keys spit out.

The pdf attached to the email and the pdf shown in the back end, may share a source file, but template overrides appear in the BE pdf and not in the email attachment pdf, and on mine, the head of the two files is different along with added information (Order Status Table) included in the email attachment (See attached images).
You start it from BE, so it checks first for overwrites in the BE. If you updated, then you have old folders in BE. There is no view invoices anylonger in the BE, delete it.

Quote from: neo314 on December 20, 2012, 00:33:19 AM
I need to at least be able to stop the email attachment from going out (just the email, no attachment).

Standard. Since 2.0.10 or so you can define the orderstatus which should be used to send the pdf, just unselect all and it should work for you.
Title: Re: Override of confirmation mails
Post by: neo314 on December 20, 2012, 15:49:06 PM
Thanks Milbo,

That is helpful. I do not have an views/invoice folder in the BE administrator/components/com_virtuemart. Must have already deleted it when I upgraded.

QuoteStandard. Since 2.0.10 or so you can define the orderstatus which should be used to send the pdf, just unselect all and it should work for you.

You can't actually unselect it in 2.0.14, hence the work around in the thread I linked to. I think it is a little confusing as well. The BE prompt is "Default Order Status to send an invoice" which to my mind could as easily be the email. I think of the email as an invoice and I get email only invoices all the time. It might be better to have the prompt say "Default Order Status to send a pdf invoice"

Thanks again.
Title: Re: Override of confirmation mails
Post by: reinhold on December 20, 2012, 20:12:21 PM
Quote from: Milbo on December 20, 2012, 12:35:21 PM
But the pdf of the email and the pdf created in the Backend are exactly the same except two small things. The header and the footer of the pdf is not exactly the same. This is the reason for the different size of logos.

Actually, the pdf invoice sent via mail and the one available in the BE are created even from different templates (invoice.php for the BE invoice, mail_html.php for the automatically sent pdf invoice!), so unless you override both to create identical output, the two types of invoice will be different!

Another problem is that the automatic pdf invoice (and the mail contents) does NOT seem to use content plugins. Since I'm using {article Allgemeine Geschäftsbedingungen}{title} {text}{/article} in the legal information, my invoices and order confirmations sent by mail do not show the terms & conditions, so I might even be in violation of the appropriate laws!

Basically, the templates used are:



The biggest issues I have with this are:

The vision that I have is that virtuemart should

Such a generic approach also has the advantage that it opens the path to serial-letter creation with company-styled prints from the VM BE. Also, it would implementing delivery notes or reminders for payment much easier.

Cheers,
Reinhold
Title: Re: Override of confirmation mails
Post by: neo314 on December 20, 2012, 20:23:45 PM
I think your premise that the PDF attached to the email and the email use the same template is incorrect. See my earlier post (with pictures)
Title: Re: Override of confirmation mails
Post by: reinhold on December 20, 2012, 20:44:00 PM
Quote from: neo314 on December 20, 2012, 20:23:45 PM
I think your premise that the PDF attached to the email and the email use the same template is incorrect.

They are using the same template, but with different variables, so the if checks in the template yield slightly different output.

Also, previously, the pdf attached to the mail didn't correctly employ the template overrides. I hope this is fixed now in the latest version (I think Milbo included the fix in 2.0.15e).
Title: Re: Override of confirmation mails
Post by: neo314 on December 20, 2012, 23:09:32 PM
Quote from: reinhold on December 20, 2012, 20:44:00 PM
Quote from: neo314 on December 20, 2012, 20:23:45 PM
I think your premise that the PDF attached to the email and the email use the same template is incorrect.

They are using the same template, but with different variables, so the if checks in the template yield slightly different output.

Also, previously, the pdf attached to the mail didn't correctly employ the template overrides. I hope this is fixed now in the latest version (I think Milbo included the fix in 2.0.15e).

Unfortunately I can't upgrade to 2.0.15x yet as two VM plugins I need broke under 20.15... b I think. How is it they use different variables. Can you elaborate on that. I concur with the approach you propose. I do think this should be a high priority for VM development and core would be best, but a plugin would help.
Title: Re: Override of confirmation mails
Post by: reinhold on December 21, 2012, 00:11:55 AM
Quote from: reinhold on December 20, 2012, 20:44:00 PM
They are using the same template, but with different variables, so the if checks in the template yield slightly different output.

Oops, sorry, I messed up something:

The two pdf generated use the same "invoice" template, but they are still very different. I'm attaching sample files (both the pdf files created by Virtuemart and the html files, which I converted to PDF in Firefox) for debugging, where I inserted a <h1> displaying each include file of the view as they are processed... I also added a sample translated string
<h2><?php echo JText::_('TESTTRANSLATION'); ?></h2> where the translation in the frontend/backend files shows whether the FE or the BE is responsible for the translation. And you can see that in the automatically generated and sent PDF invoices no content plugins are run.
{article Allgemeine Geschäftsbedingungen}{title} {text}{/article}


Quote from: neo314 on December 20, 2012, 23:09:32 PM
How is it they use different variables. Can you elaborate on that.

E.g. the mail sent to the shopper and to the vendor look quite different, but they are generated by the same "mail_html.php" view. If you look at that file, you'll see checks like
if ($this->recipient == 'shopper') {



[attachment cleanup by admin]
Title: Re: Override of confirmation mails
Post by: enserk on January 14, 2013, 09:11:40 AM
Hallo,

can anyone tell me what file the pdf invoice uses for the shipping address? I have a fixed shipping address and not the standard one; I have already changed it in the confirmation mail and the online order status but won't find the file for the pdf invoice!
Thanks in advance!