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.
The most simple way to do this is to overwrite the core PDF model for invoices.
First copy the file
app\code\core\Mage\Sales\Model\Order\Pdf\Invoice.php
to
app\code\local\Mage\Sales\Model\Order\Pdf\Invoice.php
Now open the new file and replace the following line
Mage::helper('sales')->__('Invoice # ') . $invoice->getIncrementId()
with
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 ? – Antfarm_reed Dec 2 '15 at 19:42
-
1Never mind i figured it out i just replaced
getId()
withgetIncrementId()
– Antfarm_reed Dec 3 '15 at 0:35