0121stephen Posted May 1, 2013 Share Posted May 1, 2013 Hi, I have a prestashop that is configured in multiple languages. It works fine however, when I come to dispatch orders it only prints the invoices in the language of the administrator and not the language that the order was placed in. Is there a way the I could configure my shop so that it automatically generates invoices in the language that orders were placed as opposed to what I have to do at the moment which is login and out in the language that I which to generate the invoice? Thanks in advance, Stephen matchafactory.fr 1 Link to comment Share on other sites More sharing options...
markjl Posted May 17, 2013 Share Posted May 17, 2013 Yes hello, I'd like an answer to this too if possible, thanks 1 Link to comment Share on other sites More sharing options...
vekia Posted May 17, 2013 Share Posted May 17, 2013 the most important thing: what prestashop version? Link to comment Share on other sites More sharing options...
0121stephen Posted May 17, 2013 Author Share Posted May 17, 2013 I'm using Prestashop 1.5.2. Thanks, Stephen Link to comment Share on other sites More sharing options...
markjl Posted May 17, 2013 Share Posted May 17, 2013 v1.4.9 Link to comment Share on other sites More sharing options...
vkadima Posted May 25, 2013 Share Posted May 25, 2013 Hello, Same here. I need the invoices in the language of the customer. Any idea to solve this problem? 1 Link to comment Share on other sites More sharing options...
markjl Posted May 27, 2013 Share Posted May 27, 2013 Is there a customer language field that needs to be set? I can't find one. Thanks Link to comment Share on other sites More sharing options...
markjl Posted May 31, 2013 Share Posted May 31, 2013 Hello. How can I print an invoice in French for a french customer? Thanks Link to comment Share on other sites More sharing options...
markjl Posted June 4, 2013 Share Posted June 4, 2013 Anyone in? Link to comment Share on other sites More sharing options...
tuk66 Posted June 13, 2013 Share Posted June 13, 2013 You can print invoices in customer's language as well as all languages installed in the shop with the M4 PDF Extensions module. Link to comment Share on other sites More sharing options...
markjl Posted June 13, 2013 Share Posted June 13, 2013 Why do I need a paid module to do this? Link to comment Share on other sites More sharing options...
El Patron Posted June 14, 2013 Share Posted June 14, 2013 I suggest checking that the translation for the language you want exists. You can do this by (1.4) back office--translations--> http://screencast.com/t/SgbEZXFvtg hope that helps Link to comment Share on other sites More sharing options...
CrossY Posted August 14, 2013 Share Posted August 14, 2013 I suggest checking that the translation for the language you want exists. You can do this by (1.4) back office--translations--> http://screencast.com/t/SgbEZXFvtg hope that helps I believe this doesnt work. As for a semi-workable solution, you can change the language of the admin user. I have a Spanish shop, but use an English BO. I could make a user that has Spanish as default language, and print my invoices from there. Of course, this becomes a very tedius job when you have more than one language people can order in. One comforting thought: when people order in language XX, they can download the invoice in their language. As for the real problem here: there needs to be a fix for this really.. Link to comment Share on other sites More sharing options...
markjl Posted August 14, 2013 Share Posted August 14, 2013 Initial post suggests that customers get their invoice in their chosen language I have translations present for french invoices but how, if I have a EN Back Office do I print invoices in French? I have tried the login as customer module but have not been able to install on v1.4.9 Link to comment Share on other sites More sharing options...
pzi Posted August 20, 2013 Share Posted August 20, 2013 Imho, the invoices and all documents for the customers should be in customer’s language. But all translations, for front or for back office rely only on the language of the context object (means on the language of the visitor: customer in front end or employee in back end). Prestashop should rethink the translations of the customer documents in back office. You can use this override of AdminPdfController. Valid only for version 1.5. and lightly tested only on my test version 1.5.4.1. I use it on a production site too. Please try it, and may be it could inspire some better solutions. This one is just a plaster, but is enough for my use. It switches the context language to the language of the order before generating the pdf-document. It works only for a pdf for one order. It does not work for multiple invoices in the same pdf. For a solution for multiple invoices, there are many things to change and I couldn’t find a very satisfying solution. AdminPdfController.php 2 Link to comment Share on other sites More sharing options...
markjl Posted September 4, 2013 Share Posted September 4, 2013 (edited) Again, even on v155 I can only print customer invoices in French if the BO is in French. As I am trying to use Presta as my main customer invoicing system, I do not want to change admin language to French just to print an invoice for a counter customer and I have other modules to buy rather than M4PF I request a fix just to select language to print invoice or if the customer language is French, then print a French invoice even if the BO is in English. Edited September 4, 2013 by markjl (see edit history) 1 Link to comment Share on other sites More sharing options...
kmorgen Posted March 19, 2014 Share Posted March 19, 2014 Any solution to this issue? - Still a problem in 1.5.6.2 Does not make sense the invoice is in the Admins language, and not the customers language. Link to comment Share on other sites More sharing options...
gufronsp Posted September 8, 2014 Share Posted September 8, 2014 is there any solution for this?. because i got the same issue on prestashop 1.6.Regards. Link to comment Share on other sites More sharing options...
tuk66 Posted September 8, 2014 Share Posted September 8, 2014 It is waiting the solution - http://forge.prestashop.com/browse/PSCFV-7154 Link to comment Share on other sites More sharing options...
clubvapea Posted October 3, 2014 Share Posted October 3, 2014 is there any solution for this?. because i got the same issue on prestashop 1.6. Regards. in classes/pdf/HTMLTemplate.php change: protected function getTemplate($template_name) { $template = false; $default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl'; $overriden_template = _PS_THEME_DIR_.'pdf/'.$template_name.'.tpl'; if (file_exists($overriden_template)) $template = $overriden_template; else if (file_exists($default_template)) $template = $default_template; return $template; } protected function getTemplate($template_name) { $template = false; $default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl'; $overriden_template = _PS_THEME_DIR_.'pdf/'.$template_name.'.tpl'; if (file_exists($overriden_template)) $template = $overriden_template; else if (file_exists($default_template)) $template = $default_template; // SELECT ORDER LANGUAGE FOR THE TEMPLATE if ( $this->order ) Context::getContext()->language = new Language($this->order->id_lang); return $template; } ) works at least in ps 1.6.0.9 3 Link to comment Share on other sites More sharing options...
pzi Posted October 5, 2014 Share Posted October 5, 2014 The solution of clubvapea works and is a good idea to place the language switch there, but be aware that it works only for the body of the pdf documents. The header and the footer of the pdf docs won't be in the expected language, depending on the conditions:For one invoice only: the header stays in the backoffice language.For multiple invoices in the same pdf, the header is in the language of the preceding order, and the footer is in the language of the next order (?!#*ç*%!!!)So you have to adapt header and footer so they do not depend on language. Didn't check the other documents, but I expect there will be same kind of problems. Link to comment Share on other sites More sharing options...
libertec Posted December 16, 2014 Share Posted December 16, 2014 I have been having the problem pzi describes, the pdf header was still in the backend language. I have tried to figure out a fix today and it seems the header can be generated in the order language by adding the same code to the corresponding HTMLTemplate********.php files in /classes/pdf/ Such as the following for the Invoice PDF, HTMLTemplateInvoice.php: class HTMLTemplateInvoiceCore extends HTMLTemplate { public $order; public $available_in_your_account = false; public function __construct(OrderInvoice $order_invoice, $smarty) { $this->order_invoice = $order_invoice; $this->order = new Order((int)$this->order_invoice->id_order); $this->smarty = $smarty; // SELECT ORDER LANGUAGE FOR THE TEMPLATE if ( $this->order ) Context::getContext()->language = new Language($this->order->id_lang); // header informations $this->date = Tools::displayDate($order_invoice->date_add); $id_lang = Context::getContext()->language->id; $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number); // footer informations $this->shop = new Shop((int)$this->order->id_shop); } This also seems to work in multiple PDFs generated at the same time. However I was not able to add this to an override, if i move this function to an override i get the following error: "Cannot instantiate abstract class" The footer is ok for single PDFs, but not for multiple PDFs, i have no idea why it uses the language of the next PDF in that case? Does anybody have an idea how to solve this? 1 Link to comment Share on other sites More sharing options...
brtsos Posted December 19, 2014 Share Posted December 19, 2014 in classes/pdf/HTMLTemplate.php change: protected function getTemplate($template_name) { $template = false; $default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl'; $overriden_template = _PS_THEME_DIR_.'pdf/'.$template_name.'.tpl'; if (file_exists($overriden_template)) $template = $overriden_template; else if (file_exists($default_template)) $template = $default_template; return $template; } protected function getTemplate($template_name) { $template = false; $default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl'; $overriden_template = _PS_THEME_DIR_.'pdf/'.$template_name.'.tpl'; if (file_exists($overriden_template)) $template = $overriden_template; else if (file_exists($default_template)) $template = $default_template; // SELECT ORDER LANGUAGE FOR THE TEMPLATE if ( $this->order ) Context::getContext()->language = new Language($this->order->id_lang); return $template; } ) works at least in ps 1.6.0.9 Top ! Great Job ! Link to comment Share on other sites More sharing options...
Rosie Posy Posted February 24, 2015 Share Posted February 24, 2015 hi guys, I also need invoices in French Dutch etc but the invoices are in English. How can I fix this? I use prestashop 1.6 Thanks for your help. I appreciate it VERY much! Kind regards Len Link to comment Share on other sites More sharing options...
tuk66 Posted February 24, 2015 Share Posted February 24, 2015 Invoices are printed in administrator's language in Back Office and customer's language in her account. As I know there is no chance to choose a different language for invoices. I can imagine to print invoices in Back Office in: - customer's language - selected language For bulk printing the first option can result in mixed languages, so every page can be in a different language. Everything mentioned above does the M4 PDF Extensions module. See http://www.presta-addons.com/154-large_default/pdf-extensions.jpg. Link to comment Share on other sites More sharing options...
Rosie Posy Posted April 30, 2015 Share Posted April 30, 2015 Hi guys I am using prestashop 1.6 and would like to send invoices in French to my French customers.I have looked in ...languages.. translations but there is no 'invoices' files there. Thanks for all suggestions. kind regards Len Link to comment Share on other sites More sharing options...
tuk66 Posted October 22, 2015 Share Posted October 22, 2015 It is also possible to print invoices (and other PDF documents) in two or more languages at once. The product name is always stored in customer's language. It is possible to directly print the name of the product, in more languages at once as well. Let me know if you are interested. Link to comment Share on other sites More sharing options...
mylesk42 Posted October 21, 2020 Share Posted October 21, 2020 On 10/22/2015 at 9:39 AM, tuk66 said: It is also possible to print invoices (and other PDF documents) in two or more languages at once. The product name is always stored in customer's language. It is possible to directly print the name of the product, in more languages at once as well. Let me know if you are interested. Hi, About what you said here: The product name is always stored in customer's language. It is possible to directly print the name of the product, in more languages at once as well. I'd like to know what you're proposing. I have a PS 1.6.1.17 in 2 languages Japanese and French. The company is french and based in France, but for Japanese customers so the defualt language is Japanese and second language is french. So the Japanese customers order in their native languagen Japanese and have their own invoice from their customer account in Japanese. Now, when I'm connected with the back-office in french, and try to print invoices from the back-end, they show correctly in french but ONLY the product name remains either with little squares (not decoded) or in Japanese Now, how could I have the same invoice with the product name in french ? Thanks Link to comment Share on other sites More sharing options...
tuk66 Posted October 21, 2020 Share Posted October 21, 2020 As I wrote, I suggest to use the M4 PDF Extensions module - https://www.presta-addons.com/en/prestashop-modules/3-pdf-extensions-prestashop.html I have already done several different kind of invoices and you are not limited in languages showed on the invoice. You can even have product names in any language or more languages at once. So in your case, the whole invoice can be in French regardless the customer's language. Of course, Japanese version isn't contain "little squares" as Chinese-Japanese-Korean fonts are available. 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