Sickboards Posted April 30, 2016 Share Posted April 30, 2016 Hello I am running Prestashop 1.6.1.4 and I have 10 languages installed, The issue I am now facing is if someone orders in for instance Spanish, we will have to translate the invoice back to Dutch or English to be able to see which (for instance) color options the person has chosen. Is there a way that when a customer makes an order in Spanish, the invoice will be in a specific (shop default) language? Link to comment Share on other sites More sharing options...
musicmaster Posted April 30, 2016 Share Posted April 30, 2016 Just delete the translations in that section and Prestashop will default to English. Link to comment Share on other sites More sharing options...
Sickboards Posted April 30, 2016 Author Share Posted April 30, 2016 Thanks but I can only find some folders that hold an ru.php (some modules and the filemanager), which folder are you referring to? There are some gzip files in the root\translation folder but I guess they are not being used? ps love your triple edit module 1 Link to comment Share on other sites More sharing options...
musicmaster Posted April 30, 2016 Share Posted April 30, 2016 Thanks but I can only find some folders that hold an ru.php (some modules and the filemanager), which folder are you referring to? As far as I can see the translations for your pdf's are stored in \themes\yourtheme\pdf\lang\ru.php. With instead of ru.php also other languages. But as I suppose that these language files may also contain translations for pdf's that you do want to keep it might be better not to delete them. In the face of that shared translations problem (that other pdf's contain the same string) you could also choose to adapt the form in \pdf\invoice.tpl. If you make tiny changes in the strings they are no longer recognized for the translations. Link to comment Share on other sites More sharing options...
Sickboards Posted May 1, 2016 Author Share Posted May 1, 2016 Hi, I think it is more complex, The folder \themes\yourtheme\pdf\lang only contains an index file. The invoice.tpl and invoice.product-tab.tpl only contain translation for the tabel heading not for the products, they are pulled from the database as stored. So basically I need to make sure that when the order is made the ps_order_detail contains the English/default descriptions not the translated ones. Link to comment Share on other sites More sharing options...
musicmaster Posted May 1, 2016 Share Posted May 1, 2016 The folder \themes\yourtheme\pdf\lang only contains an index file. Then the default translations from under the main directory \translations are used. The invoice.tpl and invoice.product-tab.tpl only contain translation for the tabel heading not for the products, they are pulled from the database as stored. So basically I need to make sure that when the order is made the ps_order_detail contains the English/default descriptions not the translated ones. Good point. Invoice.tpl is called from the file \classes\pdf\HTMLTemplateInvoice.php. For getting the products that file call the function order_invoice::getProducts() that can be found in the file \classes\Order\OrderInvoice.php, that calls Product::getAllCustomizedDatas() in classes\Product.php where the actual query is done. You could do some experiments with those files. Near the top of HTMLTemplateInvoice.php is a line $id_lang = Context::getContext()->language->id; Maybe changing that to an assignment of the id for English will be enough. Maybe you should also change the context language. Link to comment Share on other sites More sharing options...
tuk66 Posted May 2, 2016 Share Posted May 2, 2016 Is there a way that when a customer makes an order in Spanish, the invoice will be in a specific (shop default) language? Yes, there are patches around as well as modules. Just note that the product name and all combinations are stored in customer's language so it doesn't help to change the language of the invoice. You also need to show the real product name from the ps_product table, not only from ps_order_detail table. I have already solved it using the M4 PDF Extensions module where you can easily show the product name in several languages at once (for example English and Chinese). Link to comment Share on other sites More sharing options...
denysbezu Posted October 24, 2018 Share Posted October 24, 2018 I had the same issue on PS 1.7.3. I just added two overrides: class AdminPdfController extends AdminPdfControllerCore { public function postProcess() { if (Context::getContext()->employee != null) { if (Tools::getIsset('id_order')) { $order = new Order(Tools::getValue('id_order')); } if (Tools::getIsset('id_order_invoice')) { $orderInvoice = new OrderInvoice(Tools::getValue('id_order_invoice')); $order = $orderInvoice->getOrder(); } if ($order->id) { Context::getContext()->language = new Language($order->id_lang); Context::getContext()->shop = new Shop($order->id_shop); Context::getContext()->setTranslatorFromLocale(Context::getContext()->language->locale); } } parent::postProcess(); } } and class Context extends ContextCore { public function setTranslatorFromLocale($locale) { $translator = $this->getTranslatorFromLocale($locale); // In case we have at least 1 translated message, we return the current translator. if (count($translator->getCatalogue($locale)->all())) { $this->translator = $translator; } $this->translator = $translator; } } Hope it will help somebody. It works perfectly for me, but it is not the best solution. Link to comment Share on other sites More sharing options...
holle75 Posted February 23, 2019 Share Posted February 23, 2019 (edited) @denysbezu could you elaborate how you made those changes exactly? ... and what they´re doing? Wouldn´t it be easier to find the place where Presta is taking the language information from the Admin from and inject a variable or fixed language? Or maybe thats what your overrides are doing and i just don´t understand them? Where do you define the fixed language? I´m on Presta 1.7.5.1 and just figured out that for all invoices (customer and BO) ALWAYS (edit: i have to correct me -> attached invoice to payment accepted emails. FO if user is logged in works fine) to the language of the Admin is used. How Awkward. Edited February 23, 2019 by holle75 (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted February 25, 2019 Share Posted February 25, 2019 On 2/23/2019 at 7:42 PM, holle75 said: I´m on Presta 1.7.5.1 and just figured out that for all invoices (customer and BO) ALWAYS (edit: i have to correct me -> attached invoice to payment accepted emails. FO if user is logged in works fine) to the language of the Admin is used. How Awkward. PrestaShop works this way from version 1.0. Link to comment Share on other sites More sharing options...
holle75 Posted February 25, 2019 Share Posted February 25, 2019 Thanks Tuk66. Could you tell me if just i´m crazy about it? i mean this is simply not logical, right? Link to comment Share on other sites More sharing options...
tuk66 Posted February 25, 2019 Share Posted February 25, 2019 Why? It is logical. The customer gets the invoice in her language and you get it in your languge (one for all invoices). Link to comment Share on other sites More sharing options...
holle75 Posted February 25, 2019 Share Posted February 25, 2019 (edited) For example you have a Shop in the netherlands but your BO is set to english (because Admin is living in the UK?). -> Dutch Customer gets invoice attached to "payment accepted"- eMail in english. -> BO invoices are in english for a dutch shop. You might get a problem with the Dutch taxoffice. seems not logic to me .... Edited February 25, 2019 by holle75 (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted February 25, 2019 Share Posted February 25, 2019 OK. Everyone wants it differently. That's why the M4 PDF Extensions module can print invoices in every language you choose (in the Back Office). Link to comment Share on other sites More sharing options...
holle75 Posted February 25, 2019 Share Posted February 25, 2019 Yes, you created an awesome Module .... but it´s hard to convince yourself to pay 99,- for a needed core functionality. But thank you anyways for elaborate on this subject. First i thought it´s a bug. Link to comment Share on other sites More sharing options...
holle75 Posted February 25, 2019 Share Posted February 25, 2019 For others: I tried this idea from denysbezu https://www.prestashop.com/forums/topic/524070-how-to-set-the-invoice-language-to-always-be-english/?tab=comments#comment-2997118 What it does: when downloading Invoices in BO, they are generated in the language the customer used for the order. But still attached invoice to payment-accepted-eMail is in BO language. If anyone finds a solution for the payment-accepted-eMail-Problem .... heres the place to elaborate ;) Link to comment Share on other sites More sharing options...
thrive Posted March 5, 2019 Share Posted March 5, 2019 (edited) in /pdf/ folder edit all tpl files.... remove transalations syntac use only english text. example if u found {l s='text' d='trans-location'} make it to -> text thrive Edited March 5, 2019 by thrive (see edit history) Link to comment Share on other sites More sharing options...
holle75 Posted March 5, 2019 Share Posted March 5, 2019 Yes thrive, that´s a way, thank you for writing your thoughts ..... but then also customer invoices are only in english. It´s crazy that you have to fiddle around for such a core functionality. If you use a multilanguage shop, the shop should offer necessary settings for multilanguage! I simply want Presta to behave in a logic/configurable way. i opened an Issue here -> https://github.com/PrestaShop/PrestaShop/issues/12686 which follows to -> https://github.com/PrestaShop/PrestaShop/issues/10258 what bothers me the most is the attached invoice to "payment-accepted-mail" in Admin language. Link to comment Share on other sites More sharing options...
superskyman100 Posted March 16, 2020 Share Posted March 16, 2020 Hello Holle 75, i have same issues, Prest 1.7.6 crazy to see how Prestashop can get bugged as soon as you get more and more into it. I tend more and more to believe that they do it to oblige us to buy the half done modules that populate their addons.... On my side i just would like to send invoice with email (payment accepted) in the customer's language... In my case, the invoice sent by email is always in the shop language, not customer's language... Completely stupid !... 🥴 Wandering around the forum and NO SOLUTION (except like everytime, the 100euros ones) ! If u have any clues since your last post, please tell me Thx mate Link to comment Share on other sites More sharing options...
holle75 Posted March 17, 2020 Share Posted March 17, 2020 14 hours ago, superskyman100 said: Hello Holle 75, i have same issues, Prest 1.7.6 crazy to see how Prestashop can get bugged as soon as you get more and more into it. I tend more and more to believe that they do it to oblige us to buy the half done modules that populate their addons.... On my side i just would like to send invoice with email (payment accepted) in the customer's language... In my case, the invoice sent by email is always in the shop language, not customer's language... Completely stupid !... 🥴 Wandering around the forum and NO SOLUTION (except like everytime, the 100euros ones) ! If u have any clues since your last post, please tell me Thx mate Sorry Mate, kind of abandoned Presta. The shop is up and running, but the next little spare time i have will be used to switch to another shopsystem. Presta is rotten at it´s core. Haven´t found a solution for the invoice thing (besides other minor annoyances) best H. Link to comment Share on other sites More sharing options...
Jean Gangolf Posted August 19, 2020 Share Posted August 19, 2020 On 3/16/2020 at 5:29 PM, superskyman100 said: ... On my side i just would like to send invoice with email (payment accepted) in the customer's language... In my case, the invoice sent by email is always in the shop language, not customer's language... Completely stupid !... 🥴 ... Hello Just fount this thread cause having the same problems. Just recognized: as soon as the payment is registered as done in your BO, the incoice that the cutomer can see if he is registered is in his language. Kind of misleading if one is not sure if he/she (customer) does get it in what they understand! Link to comment Share on other sites More sharing options...
superskyman100 Posted August 20, 2020 Share Posted August 20, 2020 21 hours ago, Jean Gangolf said: Hello Just fount this thread cause having the same problems. Just recognized: as soon as the payment is registered as done in your BO, the incoice that the cutomer can see if he is registered is in his language. Kind of misleading if one is not sure if he/she (customer) does get it in what they understand! You'll have same problem with customer contact formular, PS doesn't gives back answers in the customer's language but in BO language... Lots of mis-functional stuff that cost hours and hours to figure out how to fix. I had to buy service(s) to fix plenty of little stuff like that, there is no way out if you are not programmer. Link to comment Share on other sites More sharing options...
Jean Gangolf Posted August 20, 2020 Share Posted August 20, 2020 Hello superskyman100 Thanks for your reply! Even if you have bad news... I am not a programmer, but since we (my son and me) are starting to set up a shop for him (son) we are about to learn every day a bit more of doing "handicraft" to make things work... But i have to admit that we started about mid april, and still it is not as we want to have it! Hope ypour's is working Kind regards 1 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