2

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

6

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

4
  • 1
    That's it ! Didn't think about it since we remove the first capital letter in the tagname ... thanks a lot !
    – Lanks
    Feb 20 '15 at 14:53
  • 2
    you are supposed to remove the capital letters, but only from the start of the file name. The ones in the middle have to be there.
    – Marius
    Feb 20 '15 at 14:54
  • I will definitively remember it
    – Lanks
    Feb 20 '15 at 14:55
  • hey Lanks its not necessary you have to use only first letter in capital. Magento convention is always use lowercase letter in xml file when your are overriding module. I have do practically & below code . <product_list_upsell>Sourav_Jain_Block_Upsell</product_list_upsell>
    – Sourav
    Mar 17 '15 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.