I need to replace the invoice id to order id on my invoice PDF (see image). Spent a few hours researching without finding a proper guide on getting started with customising magento's PDF :/ and explored a few extensions but i really don't wanna add an extension for this. So any help would be greatly appreciated.

enter image description here

1 Answer 1


The most simple way to do this is to overwrite the core PDF model for invoices.

First copy the file




Now open the new file and replace the following line

Mage::helper('sales')->__('Invoice # ') . $invoice->getIncrementId()


Mage::helper('sales')->__('Order # ') . $order->getId()
  • that worked ! now just a small problem, i get the order nr but only the last digits, so the order nr is 100002612 and in the pdf it only shows 2612, its not a huge problem but it would help to get the full number any ide how to fix that ? Dec 2, 2015 at 19:42
  • 1
    Never mind i figured it out i just replaced getId() with getIncrementId() Dec 3, 2015 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.