Magento - Model Override Not Working in local codePool

岁酱吖の 提交于 2019-12-04 18:53:10
kxo

Found! :)

It's extension conflicts!

How to resolve:

  1. Check extension are conflicted with this free magento module: https://marketplace.magento.com/alekseon-modules-conflict-detector.html
  2. Locate conflicted extension and use one solution for resolve (read bottom "How do I resolve conflicts?")
  3. Clear cache

In my case, a simply add extension order into the "depends" capability:

<depends>
    <Mage_Catalog />
    <Trego_Ajaxfilter />
</depends>

How do I resolve conflicts? You have 3 choices for resolving conflicts:

  1. Merge the code from one conflicting file into another and switch off the rewrite config.xml in one
  2. Switch off the rewrite in one config.xml and then make the conflicting extension PHP file extend the other extension
  3. Use the capability to make one extension depend on another. They will then rewrite in that order

Read more: http://www.webshopapps.com/blog/2010/11/resolving-magento-extension-conflicts/

Others coming here might find this useful, especially if they can find the module being loaded in "Disable Module Outputs" list: Admin Panel > Configuration > Advanced > Advanced.

Depending on how you setup your local environment you may have copied in local.xml in app/etc/local.xml that contains: <disable_local_modules>false</disable_local_modules>

Which prevents anything from the local codePool from running, while it will still show up in the Disable Module Outputs list.

Issue in your Module structure....

main issue in Cong=fig xml path and Model id path

app/code/local/Comx/Fab/Catalog/Model/Layer.php

Should be

app/code/local/Comx/Fab/Model/Catalog/Layer.php

Also change the path class according to file path

class Comx_Fab_Catalog_Model_Layer extends Mage_Catalog_Model_Layer {

to class Comx_Fab_Model_Catalog_Layer extends Mage_Catalog_Model_Layer {

All the Path structure modules are wrong and class paths.Modify all Block file path

Here the modified config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Comx_Fab>
            <version>0.2.0</version>
        </Comx_Fab>
    </modules>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <product_list_toolbar>Comx_Fab_Block_Catalog_Product_List_Toolbar</product_list_toolbar>
                </rewrite>
            </catalog>
        <page>
        <rewrite>
            <html_topmenu>Comx_Fab_Block_Page_Html_Topmenu</html_topmenu>
        </rewrite>
        </page>
        </blocks>
        <models>
        <catalog>
                <rewrite>
                    <layer>Comx_Fab_Model_Catalog_Layer</layer>
                </rewrite>
            </catalog>
        </models>
    </global>
</config>

More details of Magento module structure

http://www.insync.co.in/creating-custom-module-magento/
https://mementia.com/creating-custom-magento-module/
http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!