2015-12-02 66 views
0

試圖重寫應用程序\代碼\核心\法師\目錄\型號\資源\目錄\下面的代碼tree.php 與config.xml中Magento的覆蓋模型資源目錄樹文件​​

<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 
+0

我想你忘記關閉「/ catalog_resource>」標籤 – Ansyori

+0

不,我不會忘記關閉<「/ catalog_resource」標籤 – akgola

回答

0

使用

<global> 
      <models> 
     <catalog_resource> 
       <rewrite> 
       <category_tree>Namespce_Modulename_Model_Resource_Category_Tree</category_tree> 
       </rewrite> 
      </catalog_resource> 
      </models> 
     </global>