Monday, September 28, 2015

Magento - how to override core models

In order to override a Magento model, you should add something like this in your extension's config.xml:

 <sales>
                 
                            <rewrite>
                                  <order_creditmemo_total_subtotal>
                                      Gogi_Cmsubtotals_Model_Creditmemo_Newsubtotal
                       
                                 </order_creditmemo_total_subtotal>
                            </rewrite>
               
                   
           
          </sales>

This XML code will replace Subtotal model located in Mage/Sales/Model/Order/Creditmemo/Total folder, with Newsubtotal model located in app/code/local/Gogi/Cmsubtotals/Model/Creditmemo.


No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...