Jump to content

Carrier in invoice


Recommended Posts

Hello!

 

I have question about 1.5 versions pdf invoice. Why there are no carriers displayed in invoice? In history there are carrier displayed but in invoice no, I'm just wondering is it's on purpose or they just forgot to include it on new invoice?

And I would like to know how can I include it on my invoice.

 

best regards

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

You can put the carriers info into your invoice adding the following code :

 

Into the file classes/pdf/HTMLTemplateInvoice, inside the function getContent() , put this code:

 

 

$carrier = new Carrier((int)$this->order->id_carrier);

$this->smarty->assign(array(

'order' => $this->order,

'carrier' => $carrier,

));

 

and then in the file located in pdf/invoice.tpl, put the following code where do you want to appear into your invoice :

 

{$carrier->name} - in order to show the carrier name.

 

Best regards!

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

You can put the carriers info into your invoice adding the following code :

 

Into the file classes/pdf/HTMLTemplateInvoice, inside the function getContent() , put this code:

 

 

$carrier = new Carrier((int)$this->order->id_carrier);

$this->smarty->assign(array(

'order' => $this->order,

'carrier' => $carrier,

));

 

and then in the file located in pdf/invoice.tpl, put the following code where do you want to appear into your invoice :

 

{$carrier->name} - in order to show the carrier name.

 

Best regards!

Awesome! Just tested it, and it really works. Thanks...

Link to comment
Share on other sites

  • 1 month later...
  • 9 months later...
  • 2 weeks later...

Hello,

 

You can put the carriers info into your invoice adding the following code :

 

Into the file classes/pdf/HTMLTemplateInvoice, inside the function getContent() , put this code:

 

 

$carrier = new Carrier((int)$this->order->id_carrier);

$this->smarty->assign(array(

'order' => $this->order,

'carrier' => $carrier,

));

 

and then in the file located in pdf/invoice.tpl, put the following code where do you want to appear into your invoice :

 

{$carrier->name} - in order to show the carrier name.

 

Best regards!

 

 

Alternatively just add:

{$order_invoice->getCarrier($order_invoice->id)->name}

In pdf/invoice.tpl wherever you want the carrier name.

 

Thanks to you guys!
Very helpfull for me because I'm looking for this solution since months and I finally find it :D !
 
As Eddyb said, you just have to add this line:
{$order_invoice->getCarrier($order_invoice->id)->name}
In pdf/invoice.tpl!
 
Very easy...  :)
Link to comment
Share on other sites

  • 1 year later...
  • 10 months later...
  • 1 month later...
×
×
  • Create New...