vmn Posted April 9, 2014 Share Posted April 9, 2014 (edited) Hi, my shop supports two languages, Finnish and English. Invoice contents are always displayed in the admin language. I've overridden the class HTMLTemplateInvoice.php and added the following lines (enclosed in //VMN...). This seems to do the trick. Now the invoice text is in the language of the order. I'm, however, still very unfamiliar with Prestashop. Please let me know, if this is the way to do it. Has any other noticed this bug? 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; // header informations $this->date = Tools::displayDate($order_invoice->date_add); //VMN 2014.04.09 Context::getContext()->language = new Language($this->order->id_lang); //VMN 2014.04.09 $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); } Edited April 9, 2014 by vmn (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted April 10, 2014 Share Posted April 10, 2014 That's not a bug but a feature. There are different modes to create invoice in PrestaShop and you should test your invoice in Front Office, Back Office as well as emails. Link to comment Share on other sites More sharing options...
vmn Posted April 10, 2014 Author Share Posted April 10, 2014 (edited) Hi, we usually send the invoice within the package. This is a small shop, actually my [spam-filter]'s. What is the "Generate Invoice" when viewing Orders in the backoffice for? I've not yet found any other way to manually generate invoices. This is where the, in my opinion, bug is. Sorry, I was not accurate enough. The problem only occurs in the header part of the invoice. Thanks, Veli-Matti Edited April 10, 2014 by vmn (see edit history) Link to comment Share on other sites More sharing options...
tuk66 Posted April 10, 2014 Share Posted April 10, 2014 See http://www.presta-addons.com/3-86/pdf-extensions.jpg how the M4 PDF Extennsions module solves this issue. Link to comment Share on other sites More sharing options...
vmn Posted April 10, 2014 Author Share Posted April 10, 2014 My fix is free:). BR, Veli-Matti Link to comment Share on other sites More sharing options...
Recommended Posts