How override model in Magento correctly?

前端 未结 1 1917
感动是毒
感动是毒 2020-12-21 02:36

guys.

I need to override 2 functions in different classes (CatalogSearch/Layer.php and CatalogSearch/Mysql4/Fulltext/Collection.php). So, I have a config file:

相关标签:
1条回答
  • 2020-12-21 03:09

    The resource models are probably handled separately, try this:

    <global>
        <models>
            <catalogsearch>
                <rewrite>
                    <layer>My_Modulename_Model_CatalogSearch_Layer</layer>
                </rewrite>
            </catalogsearch>
            <catalogsearch_mysql4>
                <rewrite>
                    <fulltext_collection>My_Modulename_Model_CatalogSearch_Mysql4_Fulltext_Collection</fulltext_collection>
                </rewrite>
            </catalogsearch_mysql4>
        </models>
    </global>
    
    0 讨论(0)
提交回复
热议问题