Maniprakash Chinnasamy
Maniprakash Chinnasamy

Reputation: 2776

Overriding Magento Sub Total and Adding New Row in Admin Invoice Email

I would like to add new row after Sub total in Magento Invoice Email. Can any one point out me to which Right core file for Invoice Email rewrite?

I have tried to find the file in Magento Core files for Invoice Email new row add after the Sub Total but I don't know the right path and file name in Magento Core Folder.

Upvotes: 3

Views: 3710

Answers (2)

Maniprakash Chinnasamy
Maniprakash Chinnasamy

Reputation: 2776

I Have Rewrited the Invoice Email Sub Total and added ned row in after sub total using below rewrite rule in

    <blocks>
            <sales>
            <rewrite>
                <order_invoice_totals>Companyname_Modulename_Block_Sales_Order_Invoice_Totals</order_invoice_totals>
            </rewrite>
            </sales>
</blocks>

and rewrite the sub total in below path

<?php 
class Companyname_Modulename_Block_Sales_Order_Invoice_Totals extends Mage_Sales_Block_Order_Invoice_Totals
{
    protected function _initTotals()
    {
            parent::_initTotals();

            //Your Code Logic Here

            return $this;
    }
}

Upvotes: 0

JNDPNT
JNDPNT

Reputation: 7465

You are looking for the Totals-block. Please have a look at the link on the bottom of this post where an example is given on how to extend and add your own options

Basically you have to indicate to magento that in certain types like quote, invoice, ... you want to add a "total" item, you can give the position as in the example:

<global>
        <sales>
            <quote>
                <totals>
                    <yourcompany_yourmodule>
                        <class>company_module/path_to_class</class>
                        <after>subtotal</after>
                        <before>tax</before>
                    </yourcompany_yourmodule>
                </totals>
            </quote>
            <order_invoice>
                <totals>
                    <yourcompany_yourmodule>
                        <class>company_module/path_to_class</class>
                        <after>subtotal</after>
                        <before>tax</before>
                    </yourcompany_yourmodule>
                </totals>
            </order_invoice>
            <order_creditmemo>
                <totals>
                    <yourcompany_yourmodule>
                        <class>company_module/path_to_class</class>
                        <after>subtotal</after>
                        <before>tax</before>
                    </yourcompany_yourmodule>
                </totals>
            </order_creditmemo>
        </sales>
    </global>

Than you have to create the right classes and extend from the wanted classes.

More info and steps: http://turnkeye.com/blog/magento-development-add-total-row-checkout/

Upvotes: 3

Related Questions