Overriding Magento Sub Total and adding a new line to the admin email address

I would like to add a new line after Sub total in Magento Invoice Email. Can anyone point me to which right main file for the invoice to overwrite?

I tried to find a file in Magento Core files to add a new line Invoice Email after Sub Total, but I don't know the correct path and filename in Magento Core Folder.

+3


source to share


2 answers


You are looking for Totals-block. See the link at the bottom of this post for an example of how to extend and add your own parameters.

Basically you have to tell magento that in some types like quote, invoice, ... you want to add a "generic" item, you can specify the position like 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 need to create the classes you want and go from the required classes.

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

+3


source


I rewrote the email address for the Invoice Total and added the line ned after the grand 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 overwrite the total in the 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;
    }
}

      

0


source







All Articles