Jump to content
  • 0

[SOLVED]Invoice.tpl override prestashop 1.6


jeanjeanjeana

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 (see edit history)
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 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
Link to comment
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 ! ) 

Link to comment
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.

Link to comment
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!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...