Jump to content

Invoices in multiple languages in 1.6.0.5


vmn

Recommended Posts

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 by vmn (see edit history)
Link to comment
Share on other sites

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 by vmn (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...