Magento – Fix Rewrite Adminhtml Model Not Working

adminhtmloverrides

I need to rewrite app/code/core/Mage/Adminhtml/Model/System/Config/Source/Catalog/ListSort.php

my config.xml :

...
<global>
   <models>
       <mymodule>
            <class>My_Module_Model</class>
        </mymodule>
       <adminhtml>
            <rewrite>
                <system_config_source_catalog_listsort>My_Module_Model_Adminhtml_System_Config_Source_Catalog_ListSort</system_config_source_catalog_listsort>
            </rewrite>
        </adminhtml>
     </models>
 </global>
 ...

app/code/local/My/Module/Model/Adminhtml/System/Config/Source/Catalog/ListSort.php

<?php
 class My_Module_Model_Adminhtml_System_Config_Source_Catalog_ListSort
 extends Mage_Adminhtml_Model_System_Config_Source_Catalog_ListSort 
{
    public function toOptionArray()
    {
        var_dump('TEST');
    }
}

Also My_Module already rewrite lot of models.

Please help me to find what i'm doing wrong.
Thanks

Best Answer

Change the tag name from <system_config_source_catalog_listsort> to <system_config_source_catalog_listSort>

Related Topic