Trying to override app\code\core\Mage\Catalog\Model\Resource\Category\tree.php with config.xml
<global>
<models>
<catalog_resource>
<rewrite>
<category>Namespce_Modulename_Model_Resource_Category_Tree</category>
</rewrite>
</catalog_resource>
</models>
</global>
and my class is defined in folder local\Namespce\Modulename\Model\Resource\Category\Tree.php
class Namespce_Modulename_Model_Resource_Category_Tree extends Mage_Catalog_Model_Resource_Category_Tree
{
here is functions and code
}
it gives error Call to undefined method
Namespce_Modulename_Model_Resource_Category_Tree::checkId() in app\code\core\Mage\Catalog\Model\Category.php on line 671
While it is working fine if we put folder path in locally app\code\local\Mage\Catalog\Model\Resource\Category
Please help me anybody.
2 Answers 2
This is working, use <category_tree> instead of only <category>:
<global>
<models>
<catalog>
<rewrite>
<category_tree>Namespce_Modulename_Model_Resource_Category_Tree</category_tree>
</rewrite>
</catalog>
</models>
</global>
-
Hi,we have already tried but not working.akgola– akgola2015年12月02日 08:37:57 +00:00Commented Dec 2, 2015 at 8:37
-
try with updated answerMinesh Patel– Minesh Patel2015年12月02日 08:58:37 +00:00Commented Dec 2, 2015 at 8:58
-
great .......!!Minesh Patel– Minesh Patel2015年12月02日 09:01:45 +00:00Commented Dec 2, 2015 at 9:01
-
you can accept and upvoteMinesh Patel– Minesh Patel2015年12月02日 09:02:27 +00:00Commented Dec 2, 2015 at 9:02
use this to override the category_tree model. it is tested and working
<global>
<models>
<catalog_resource>
<rewrite>
<category_tree>Namespce_Modulename_Model_Resource_Category_Tree</category_tree>
</rewrite>
</catalog_resource>
</models>
</global>