Teddy's Dad Posted March 25, 2018 Share Posted March 25, 2018 Hello all I had a quick best practice question. I am modifying invoice tpl files in the "pdf" folder. What is the best way of doing this? just change the tpl files in that folder or can I do an override somewhere safer? I have been looking online but cannot see a definite answer. I see how to override existing modules, even core controller files, but not sure about the pdf. Can I just copy the pdf folder to my own module's override folder? (which I prefer) or prestashop's override folder? Adding it to the theme's folder makes me think I could potentially lose my changes if the theme has an update. Any advice would be greatly appreciated as to where exactly to put my modified pdf tpl files. Best wishes Nima Link to comment Share on other sites More sharing options...
tdsoft Posted April 3, 2018 Share Posted April 3, 2018 Hi, Prestashop system do not allow override /pdf/*.tpl from your theme If you want change layout or something from there TPL files, you must DIRECTLY edit from /pdf/*.tpl 1 Link to comment Share on other sites More sharing options...
tuk66 Posted April 16, 2018 Share Posted April 16, 2018 You can also look into modules to override the default invoices. They offer more options and are easily pluggable. 1 Link to comment Share on other sites More sharing options...
theodiablo Posted September 17, 2021 Share Posted September 17, 2021 I'm reviving this topic because I think both answers given before are wrong. Maybe they are outdated? From the Prestashop Dev Doc: Customize the PDF files templates All PDF generated by PrestaShop are using Smarty templates and TCPDF as PDF rendering engine. You will find all theses templates in the pdf folder, for each use case managed natively by the Core. You can alter the Core files OR override them by copying them on themes/<your-theme>/pdf folder. It’s not possible to override a PDF template in a module. You can see more info here on how to customize the PDF template here: https://devdocs.prestashop.com/1.7/modules/concepts/pdf/ So to sum up: You can override the template files by copying them in your theme /php folder You can't edit the templates from a module Hope it will help someone. Good luck! ;-) 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now