[英]Magento: overriding Mage_CatalogSearch_Model_Resource_Helper_Mysql4
I spent almost two days on searching the web about this topic, but i don't know why my class doesn't override Mage_CatalogSearch_Model_Resource_Helper_Mysql4 (core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php). 我花了将近两天的时间在网上搜索有关此主题的内容,但是我不知道为什么我的课程不会覆盖Mage_CatalogSearch_Model_Resource_Helper_Mysql4(core / Mage / CatalogSearch / Model / Resource / Helper / Mysql4.php)。
My class is 我的课是
class Company_Module_Model_Override_CatalogSearch_Resource_Helper_Mysql4 extends
Mage_CatalogSearch_Model_Resource_Helper_Mysql4
{
}
the file is located in local/Company/Module/Model/Override/CatalogSearch/Resource/Helper/Mysql4.php 该文件位于本地/公司/模块/模型/替代/ CatalogSearch /资源/Helper/Mysql4.php
My config file is: 我的配置文件是:
<global>
<models>
<catalogsearch_resource_helper>
<rewrite>
<mysql4>Company_Module_Model_Override_CatalogSearch_Resource_Helper_Mysql4</mysql4>
</rewrite>
</catalogsearch_resource_helper>
</models>
</global>
The module override other modules without problems, so I cannot figure out how to solve... Any idea? 该模块可以覆盖其他模块而不会出现问题,因此我无法弄清楚如何解决...有任何想法吗? Thank you
谢谢
Enzo,而不是做所有这些事情,只需从核心目录app \\ code \\ core \\ Mage \\ CatalogSearch \\ Model \\ Resource \\ Helper复制Mysql.php并将其粘贴到本地目录app \\ code \\ local \\ Mage \\ CatalogSearch \\ Model \\资源\\助手,并相应地修改您的代码
I am posting here the solution I came up with. 我在这里发布我想出的解决方案。 The right override declaration in the config.xml file should be as following:
config.xml文件中的正确覆盖声明应如下所示:
<global>
<models>
<catalogsearch_resource>
<rewrite>
<helper_mysql4>Company_Module_Model_Override_CatalogSearch_Resource_Helper_Mysql4</helpr_mysql4>
</rewrite>
</catalogsearch_resource>
</models>
</global>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.