Jump to content

Edit History

c64girl

c64girl

For people that want add to invoice a order ID just do

$this->smarty->assign(['order_reference' => $this->order->id]);

 

c64girl

c64girl

On 11/3/2022 at 5:24 PM, lordignus said:

First you need to add it into the getHeader method of the HTMLTemplateInvoice class (classes/pdf/HTMLTemplateInvoice.pdf)

public function getHeader()
    {
        $this->assignCommonHeaderData();
        $this->smarty->assign(['header' => Context::getContext()->getTranslator()->trans('Invoice', [], 'Shop.Pdf')]);
        $this->smarty->assign(['order_reference' => $this->order->reference]); /* add this line! */

        return $this->smarty->fetch($this->getTemplate('header'));
    }

Then you can use {$order_reference} in header.tpl

How can i get order ID?

$this->smarty->assign(['order_reference' => $this->order->order_id]);

?

 

×
×
  • Create New...