Search code examples
magentomagento-1.9

How to override Mage_Tax renderer in Magento


I want to override the getShippingIncludeTax() method in the class Mage_Tax_Block_Checkout_Shipping , this block is defined as a renderer in the config;

<sales>
    <quote>
        <totals>
            <shipping>
                <renderer>tax/checkout_shipping</renderer>
            </shipping>
        </totals>
    </quote>
</sales>

I can override a block if needed, but this class doesn't have any Block definition. How do I override this?

NOTE: This is not a typical Block override.


Solution

  • You can just create a module that overrides Mage_Tax_Block_Checkout_Shipping...

     <global>
        <blocks>
            <tax>
                <rewrite>
                    <checkout_shipping>Test_TestModule_Block_Tax_Checkout_Shipping</checkout_shipping>
                </rewrite>
            </tax>
        </blocks>
    </global>