0

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).

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

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

4

2 回答 2

0

Enzo,不要做所有这些事情,只需从核心目录 app\code\core\Mage\CatalogSearch\Model\Resource\Helper 复制 Mysql.php 并将其粘贴到本地目录 app\code\local\Mage\CatalogSearch\Model\ Resource\Helper 并相应地修改您的代码

于 2013-10-24T09:36:45.353 回答
0

我在这里发布我想出的解决方案。config.xml 文件中的正确覆盖声明应如下所示:

<global>
    <models>
        <catalogsearch_resource>
            <rewrite>
                  <helper_mysql4>Company_Module_Model_Override_CatalogSearch_Resource_Helper_Mysql4</helpr_mysql4>
            </rewrite>
        </catalogsearch_resource>
    </models>
</global>
于 2019-01-17T12:49:20.470 回答