Jump to content
  • 0
jeanjeanjeana

[SOLVED]Invoice.tpl override prestashop 1.6

Question

Hello !! 

 

I want to modify my invoice, to add new or different fields without modifying the source code of invoice.tpl ( I don't want to have problems with the future update of the software), so I want to override this file (invoice.tpl) but I don' know where to override it because the original file is in /pdf/invoice.tpl and in /override there is no pdf directory...

 

I work with prestashop 1.6 

 

Thank for your help ! =) 

Edited by jeanjeanjeana

Share this post


Link to post
Share on other sites

12 answers to this question

Recommended Posts

  • 0

You can override PHP classes only. Not templates. And you are right, invoice template is significantly changed in the coming version 1.6.1.0.

Share this post


Link to post
Share on other sites
  • 0

Thank you for your very quick answers selectshop.at ! It work very well when I put my new invoice.tpl file in themes\default-bootstrap\pdf !! =) 

Edited by jeanjeanjeana

Share this post


Link to post
Share on other sites
  • 0

Yes, but this is only a override theme based, but not a core override, which is not possible on Prestashop Cloud. Theme based you can change what you want and it will work for Prestashop Cloud. Also by including JS on your theme which are added as module (certified) are possible, but no changes to the core.

 

folder /pdf is a part of core, not the same as themes/default/pdf

  • Like 1

Share this post


Link to post
Share on other sites
  • 0

OK, but I just want to modify the aspect of my invoice so this method is ok no ? And it will not cause any problems with the future update of prestashop software ? ( Sorry if I don't exactly understand what you are saying.. It has been only 3 weeks since I work on Prestashop ! ) 

Share this post


Link to post
Share on other sites
  • 0

Yes it is ok when you change the aspect/design of your invoice on /themes/pdf, cause it is attached to your theme. What you cannot modify is the logic of it (so core scriptings) on Cloud which is the locationfolder /pdf only.

Edited by selectshop.at
  • Like 1

Share this post


Link to post
Share on other sites
  • 0

Thank you, problem solved. Similar to me, i put my edited PDF under: mytheme/pdf/

Share this post


Link to post
Share on other sites
  • 0

Hello, can some one tell me what files to edit to customize PDF? Are that files located here /prestashop/pdf/invoice.tp etc or in prestashop/themes/default_bootstrap/pdf ?

 

Share this post


Link to post
Share on other sites
  • 0

:D You better don't trust those self-proclaimed experts! No, I'm not speaking of tuk66; he's a real expert!

There are no serious restrictions for modifying the invoice template on PrestaShop cloud.

It is possible both to change the invoice template (Incl b2b, which btw was most recently updated on the Github dev branch for 1.6.1) - and the database fields you want to be displayed.

Like it was said you may create as many pdf files as you want, as long as they're stored in the theme's pdf folder, which works lIke an override. If you want to know, which files you have to modify, just have a look into a fresh 1.6.1.5 zip.

Currently we have 9 plus 3 basic files (header.tpl, invoice.tpl, footer.tpl) from which at runtime the pdf is generated. Nine, because since a few days there is a separate file to display (again) the notes in the pdf. Just have a look here:

https://github.com/PrestaShop/PrestaShop/tree/develop/pdf

But it is still possible to create a pdf with a single invoice file. I developed a customized one-file solution, for download here: https://www.prestashop.com/forums/topic/244719-tutorial-rechnungsformular-%C3%A4ndern-f%C3%BCr-version-15x-und-16x/page-6?p=2198983&do=findComment&comment=2198983

 

After uploading you can choose your invoice in

BO  --> Orders --> Invoices
To change some of the content, feel free to override the /classes/pdf/*.php and upload your modified fIles to the overrides directory.

This is not only possible on your own server but on the cloud server too.

Share this post


Link to post
Share on other sites
  • 0

From what I know the latest Prestashop Version on Cloud is 1.6.1.4.?

 

@ZikmaSolutions - the files you should add/find if still available in themes folder, so /themes/your theme/pdf.

Share this post


Link to post
Share on other sites
  • 0

From what I know the latest Prestashop Version on Cloud is 1.6.1.4.?

This has no impact, it's always recommended to use the newest files possible because we did some major bug fixes in the invoice generation in recent time.

The Prestashop release of a cloud shop normally depends on the date of installation. For example, my test cloud shop wasn't updated since 1.6.1.1!

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More