zAy Posted February 8, 2013 Share Posted February 8, 2013 Hello, I searched the forums but no result about this tricky one: We all know that customers receive their emails according to their shop language when they confirm the order, and that the language ID is included within each order record in the DB. This also applies to the mailalerts module that sends us ( the admins ) an email about new orders in the language of the customer. My Goal: I would like to generate all PDF files (invoice, delivery, credit slip ... ) according to the order language and not to the BO or Shop language. Even if the customer changes the shop language and downloaded the invoice again, it shows according to the language he used when he placed that order. Current Situation: I have 2 languages (english and french), soon they will be 4. I had the lightbulb in head and created 2 Order statuses named (ENGLISH and FRENCH) that will be hidden on customers, and used only to "Flag" an order with ENGLISH or FRENCH Status according to the mail language when i receive that order. So that when i want to print the invoice and delivery PDFs, i will change the BO language first accordingly. This will be annoying soon... My Question: Is that possible ? even if sophisticated, i thought maybe in the pdf templates where we call the {l s: maybe we can choose according to order ID ? Any thoughts or solutions are much appreciated !! Cheers ! PS 1.5.3.1 Link to comment Share on other sites More sharing options...
zAy Posted February 10, 2013 Author Share Posted February 10, 2013 Hello, Still no answer for this topic while it could be of great use for the entire community.. Nobody knows where the decision is taken for the language of the PDFs ? I am sure it is somewhere and we just need to point to the order language instead of website language. Thanks again for any leading hint.. Link to comment Share on other sites More sharing options...
Rand0mDude Posted February 17, 2017 Share Posted February 17, 2017 I know that this topic is actually pretty old, but i spent like 3 days searching for the right solution to a similar problem. I found the solution here: https://www.prestashop.com/forums/topic/396155-need-to-display-double-currency-and-change-pdf-language/ Thank you so much Martijn! I actually did change that a little bit though, I did an override of the specific HTMLTemplate Class (in my case HTMLTemplateSupplyOrderForm) and redefined the getTemplate method which was inherited by the HTMLTemplate class. My override looks like this: HTMLTemplateSupplyOrderForm extends HTMLTemplateSupplyOrderFormCore { protected function getTemplate($template_name) { $template = parent::getTemplate($template_name); Context::getContext->language = new Language($this->supply_order->id_lang); return $template; } } I hope this can help someone 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