VirtueMart invoice overrides don't working?

Recently a co-worker asked my help for a seemingly trivial problem, he complained that whatever he does, the template overrides for the invoices done by the book aren't working. Well, the cause is simple - and is not really qualifying as a hack for non-rookies, but since the solution involves deleting files in Joomla's filesystem, the procedure can harm your site. So, put your helmet on, fasten your seat belt, and do a backup.

So, if you have run into trouble, find in the VirtueMart Configuration>Templates tab the Safe Path variable. This is the place  where VirtueMart places the files generates, like the PDF files for invoices.

The (apparent) problem of non working overrides is generated by the way VirtueMart handles these files. These are generated only once, and until the file is found in the location found in the SafePath variable, will not be re-generated. So, go to that directory, found the /invoices folder, and delete the invoice you are using for testing.

When done, go to the Orders in the VirtueMart backend, locate the invoice, and in the Print View column click on the PDF icon. This way you will force the generating of the invoice - this time with the changes you made in the template override.

That's it. Enjoy.

PS. Use this tip at your own risk, no guarantees of any kind.