2014-06-07

Rewrite class/method in Magento

To rewrite class method you have to add rewrite config to etc/config.xml:

 
  
   
    
     SliRx_Test_Model_Category
    
   
  
 

Where tags "catalog" and "category" are assigned to Mage::getModel('catalog/category')
Than create corresponding class at app/code/local/SliRx/Test/Model/Category.php:
class SliRx_Test_Model_Category extends Mage_Catalog_Model_Category
{
    public function getChildren()
    {
        return $this->getResource()->getChildren($this, false);
    }
}

No comments:

Post a Comment