Rewrite exiting Magento models

To rewrite exiting Magento models, you can add the following snippet to your modules config.xml:

<?xml version="1.0"?>
<config>
    <modules>
        <AskSheldon_Module>
            <version>0.1.3</version>
        </AskSheldon_Module>
    </modules>
    <!-- ... -->
    <global>
        <models>
            <checkout>
                <rewrite>
                    <session>AskSheldon_Module_Model_Checkout_Session</session>
                    <type_onepage>AskSheldon_Module_Model_Checkout_Type_Onepage</type_onepage>
                </rewrite>
            </checkout>
        </models>
    </global>
    <!-- ... -->
</config>

In this case Mage_Checkout_Model_Session and Mage_Checkout_Model_Type_Onepage are rewritten.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.