Jump to content

[SOLVED]How to Add Delivery Address at the bottom of Delivery Slip


Recommended Posts

I want to put the delivery address at the bottom of delivery slip, right below footer, so that the operator can tear it off and stick it in the box. However I can't put the command under Function Footer inside pdf.php since it doesn't have parameter for $id_order. Can anyone advise me what to do?

TIA,
boylibre

Link to comment
Share on other sites

Managed to find a solution after so many trials & errors. Anyone interested can use it at your own risk - so backup before making any changes.

Here are some code I added under footer function inside pdf.php

//These are the variables to be declared before they can be used
$delivery_address = new Address(intval(self::$order->id_address_delivery));
$deliveryState = $delivery_address->id_state ? new State($delivery_address->id_state) : false;
//These are examples how to use them
$this->SetFont(self::fontname(), '', 12);
$this->Cell(190, 10, Tools::iconv('utf-8', self::encoding(), $delivery_address->firstname).' '.Tools::iconv('utf-8', self::encoding(), $delivery_address->lastname.' (ORDER#: '.sprintf('d', self::$order->id).')'."\n"), 'T', 1, 'L');
$this->Cell($width, 5, Tools::iconv('utf-8', self::encoding(), $delivery_address->address1), 0, 'L');



Cheers

Link to comment
Share on other sites

  • 2 months later...
Managed to find a solution after so many trials & errors. Anyone interested can use it at your own risk - so backup before making any changes.
This is kind of a dirty hack, but it does the job for me, thanks!

BTW, you forgot to mention which pdf.php you should edit ... it's the one in /classes/ :-)
Link to comment
Share on other sites

×
×
  • Create New...