Jump to content

PDF Invoice title cannot be translated after update to 1.6.1.0


Recommended Posts

Hello folks.

 

After update from 1.6.0.14 to 1.6.1.0 The PDF invoice has reset to English instead of Danish as we used in version 1.6.0.14. I can translate everything in the invoice except the invoice title where it says "Invoice". I need this to be translated to Danish so it writes "Faktura" instead.

 

I have the same problem in delivery slip and probably other generated PDF files.

 

Does anyone know how to translate this? I have changed all translations where it writes "Invoice" both in the english and the danish translations (module translations, field translations, back office translations and PDF translations) but still it writes "Invoice" and not "Faktura" in the invoice PDF title and "Delivery slip" in the delivery title PDF.

 

I am unsure if it is a prestashop core issue or me, who has not found the right place of the translation.

post-963218-0-33855300-1436345350_thumb.jpg

Edited by jalokin80 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

In your prestashop installation, locate the following file.

 

in your_prestashop_installation/classes/pdf/HTMLTemplateInvoice.php

 

edit line 64

'header' => $this->l('INVOICE'),

to

'header' => $this->l('FAKTURA'),

In the example above I use the danish word for Invoice which is Faktura. Change it to whatever language you want.

Use for example notepad2 to edit the php file. It can be downloaded for free and you can find it in google.

 

You can do the same in the rest of the PDF titles (HTMLTemplateDeliverySlip.php, HTMLTemplateOrderSlip.php, etc.) Just search for

$this->l

and change the title to whatever translation you want.

Link to comment
Share on other sites

In your prestashop installation, locate the following file.

 

in your_prestashop_installation/classes/pdf/HTMLTemplateInvoice.php

 

edit line 64

'header' => $this->l('INVOICE'),

to

'header' => $this->l('FAKTURA'),

In the example above I use the danish word for Invoice which is Faktura. Change it to whatever language you want.

Use for example notepad2 to edit the php file. It can be downloaded for free and you can find it in google.

 

You can do the same in the rest of the PDF titles (HTMLTemplateDeliverySlip.php, HTMLTemplateOrderSlip.php, etc.) Just search for

$this->l

and change the title to whatever translation you want.

 

Thank's for patch, but how can we do if we have a multilanguage shop ? :-(

 

John

Link to comment
Share on other sites

Found a workaround, that could certainly help ;-)

 

Add the following lines in your themes/yourtheme/pdf/header.tpl

<!--
{l s='INVOICE' pdf='true'}
{l s='DELIVERY' pdf='true'}
{l s='DELIVERY SLIP' pdf='true'}
{l s='ORDER RETURN' pdf='true'}
{l s='CREDIT SLIP' pdf='true'}
-->


Then, just run regular translation in backoffice ( PDF, Yourtheme, language) and tranlate it.

 

That's all folks!

Edited by Prestashop Addict (see edit history)
  • Like 2
Link to comment
Share on other sites

Found a workaround, that could certainly help ;-)

 

Add the following lines in your themes/yourtheme/pdf/header.tpl

<!--
{l s='INVOICE' pdf='true'}
{l s='DELEVERY' pdf='true'}
{l s='DELIVERY SLIP' pdf='true'}
{l s='ORDER RETURN' pdf='true'}
{l s='CREDIT SLIP' pdf='true'}
-->


Then, just run regular translation in backoffice ( PDF, Yourtheme, language) and tranlate it.

 

That's all folks!

 

Thank you!!! This is the solution for a multilanguage shop

Link to comment
Share on other sites

Thank you Prestashop Addict for the solution!

 

Unfortunately I did not have the header.tpl in my themes/yourtheme/pdf/ directory so instead I added the code to:

 

Prestashop installation directory/pdf/header.tpl

 

It works for me and for the custom theme I use.

 

Also you have a typo in the addition:

{l s='DELEVERY' pdf='true'}

I have changed that to:

<!--
{l s='INVOICE' pdf='true'}
{l s='DELIVERY' pdf='true'}
{l s='DELIVERY SLIP' pdf='true'}
{l s='ORDER RETURN' pdf='true'}
{l s='CREDIT SLIP' pdf='true'}
-->

... and translated the fields in BO. Now the hack works very well and also with special characters, which did not work with the previous solution :)

 

Thumbs up!

Link to comment
Share on other sites

Thank you jalokin80 for my spelling mistake, I corrected my original post :-)

Unfortunately your solution to modify orignal code is not the best, because on update it will be overwritten.

I suggest you to create a folder in your theme /themes/yourtheme/pdf/, then copy the original /pdf/haeder.tpl to /themes/yourtheme/pdf/ and modify it.

Have fun.

Link to comment
Share on other sites

  • 1 month later...
  • 2 years later...

hello i want to quit the contry name down my logo on PDF invoice how i can do that ??

 

hola !! me pueden decir como le quito el pais de debajo de mi logo a la factura PDF que genera prestashop , ya que me aparece al generar el PDF el pais me imagino por defecto de la tienda justo debajo del logo de mi marca, tengo prestashop 1.6 mil gracias !!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...