Magento PDF Shipping Notice
I am trying to add a custom note to Magento PDF Invoice documents. I am using the Deliverynote plugin.
I am trying to add this piece of code to the invoice.php code, but I am not getting any results.
$noteId = Mage::registry('current_invoice')->getOrder()->getData('delivery_note_id');
$this->_note = Mage::getModel('deliverynote/note')->load($noteId)->getNote();
Here is the Github location https://github.com/drewhunter/ShipNote
I tried to do this as well.
$ newnote = new Dh_Deliverynote_Block_Adminhtml_Sales_Order_Note ();
$newnote->_initNote();
$var = $newnote->$_note;
$vars = serialize($var);
$this->insertDocumentNumber(
$page,
Mage::helper('sales')->__('Invoice # ') . $vars . $invoice->getIncrementId()
);
How do I embed this in PDF?
+3
source to share
1 answer
So what actually worked. This may have come from the original $ order variable in invoice.php, but I leave it as it is since it works.
$order3 = Mage::getModel('sales/order')->loadByIncrementId($order->getIncrementId());
$shipNoteId = $order3->getData('delivery_note_id');
$note = Mage::getModel('deliverynote/note')->load($shipNoteId)->getData('note');
Then after adding it to the pdf invoice, I created the insertNote function.
$this->insertNote(
$page,
Mage::helper('sales')->__('USPS INSTRUCTIONS: ') . $note
);
I also made a video showing how to do this in Magento. http://youtu.be/bjZ31AlmN2I
+1
source to share