enter image description here

I want to print total paid and total due in the invoice and shipment pdf in magento.

i can now able to print subtotal tax and grand total

please help me

1 Answer 1


So for the invoice pdf printing take a look at the model Mage_Sales_Model_Order_Pdf_Invoice. This is the standard model invoice pdf creation and the "magic" happens during the function getPdf.

But since you are only working with totals what you are actually interested in is the function insertTotals. Yeah it is in its own function but is on the abstract model Mage_Sales_Model_Order_Pdf_Abstract and not the Invoice level.

If you continue to dive down into the functions it will appear as if there is a function to load all the totals, which for you look hopeful. This function is Mage_Sales_Model_Order_Pdf_Abstract::_getTotalsList what is interesting here is that if appears to load the totals from the config.xml.

$totals = Mage::getConfig()->getNode('global/pdf/totals')->asArray();

So it appears very possible to inject your own totals to be printed in the pdf, though you do have to be careful as to which totals will be shown as this by default happens on the global pdf level and I am not sure how it effects the pdf when the total is not set or if it is zero.

  • But you haven't specified which/what tag to be added for printing the "Total Due" amount to the Pdf.
    – Vicky Dev
    Commented Mar 8, 2016 at 10:47

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.