Skip to main content
edited tags
Link
Amit Bera
  • 77.7k
  • 20
  • 124
  • 239
added 8 characters in body
Source Link

I am trying to override a adminhtml block and I created all files accordingly. The problem is that it does not have any effect. My files are as follows:

app/code/local/Grando/Groupfilter/etc/config.xml

<?xml version="1.0"?>
 
<config>

<modules>

    <Grando_Groupfilter>

        <version>1.0</version>

    </Grando_Groupfilter>

</modules>

<global>
    <blocks>
    <grando_groupfilter>
        <class>Grando_Groupfilter_Block</class>
    </grando_groupfilter>
        <adminhtml>
            <rewrite>
                <catalog_product_edit_tab_super_group>Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group</catalog_product_edit_tab_super_group>
            </rewrite>
        </adminhtml>
    </blocks>
</global>   

</config>
  

app/code/local/Grando/Groupfilter/Block/Adminhtml/Catalog/Product/Edit/Tab/Super/Group.php

class Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group {
   protected function _prepareCollection()
{
    //somecodehere
} 
   }

app/etc/modules/Grando_Groupfilter.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Grando_Groupfilter>
            <active>true</active>
            <codePool>local</codePool>
        </Grando_Groupfilter>
    </modules>
</config>

Is it not possible to do this? Am I missing something?

I am trying to override a adminhtml block and I created all files accordingly. The problem is that it does not have any effect. My files are as follows:

app/code/local/Grando/Groupfilter/etc/config.xml

<?xml version="1.0"?>
 <modules>

    <Grando_Groupfilter>

        <version>1.0</version>

    </Grando_Groupfilter>

</modules>

<global>
    <blocks>
    <grando_groupfilter>
        <class>Grando_Groupfilter_Block</class>
    </grando_groupfilter>
        <adminhtml>
            <rewrite>
                <catalog_product_edit_tab_super_group>Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group</catalog_product_edit_tab_super_group>
            </rewrite>
        </adminhtml>
    </blocks>
</global>   
 

app/code/local/Grando/Groupfilter/Block/Adminhtml/Catalog/Product/Edit/Tab/Super/Group.php

class Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group {
   protected function _prepareCollection()
{
    //somecodehere
} 
   }

app/etc/modules/Grando_Groupfilter.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Grando_Groupfilter>
            <active>true</active>
            <codePool>local</codePool>
        </Grando_Groupfilter>
    </modules>
</config>

Is it not possible to do this? Am I missing something?

I am trying to override a adminhtml block and I created all files accordingly. The problem is that it does not have any effect. My files are as follows:

app/code/local/Grando/Groupfilter/etc/config.xml

<?xml version="1.0"?>

<config>

<modules>

    <Grando_Groupfilter>

        <version>1.0</version>

    </Grando_Groupfilter>

</modules>

<global>
    <blocks>
    <grando_groupfilter>
        <class>Grando_Groupfilter_Block</class>
    </grando_groupfilter>
        <adminhtml>
            <rewrite>
                <catalog_product_edit_tab_super_group>Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group</catalog_product_edit_tab_super_group>
            </rewrite>
        </adminhtml>
    </blocks>
</global>   

</config>
 

app/code/local/Grando/Groupfilter/Block/Adminhtml/Catalog/Product/Edit/Tab/Super/Group.php

class Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group {
   protected function _prepareCollection()
{
    //somecodehere
} 
   }

app/etc/modules/Grando_Groupfilter.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Grando_Groupfilter>
            <active>true</active>
            <codePool>local</codePool>
        </Grando_Groupfilter>
    </modules>
</config>

Is it not possible to do this? Am I missing something?

Source Link

Extending Adminhtml blocks class _prepareCollection

I am trying to override a adminhtml block and I created all files accordingly. The problem is that it does not have any effect. My files are as follows:

app/code/local/Grando/Groupfilter/etc/config.xml

<?xml version="1.0"?>
<modules>

    <Grando_Groupfilter>

        <version>1.0</version>

    </Grando_Groupfilter>

</modules>

<global>
    <blocks>
    <grando_groupfilter>
        <class>Grando_Groupfilter_Block</class>
    </grando_groupfilter>
        <adminhtml>
            <rewrite>
                <catalog_product_edit_tab_super_group>Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group</catalog_product_edit_tab_super_group>
            </rewrite>
        </adminhtml>
    </blocks>
</global>   

app/code/local/Grando/Groupfilter/Block/Adminhtml/Catalog/Product/Edit/Tab/Super/Group.php

class Grando_Groupfilter_Block_Adminhtml_Catalog_Product_Edit_Tab_Super_Group extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Group {
   protected function _prepareCollection()
{
    //somecodehere
} 
   }

app/etc/modules/Grando_Groupfilter.xml

    <?xml version="1.0"?>
<config>
    <modules>
        <Grando_Groupfilter>
            <active>true</active>
            <codePool>local</codePool>
        </Grando_Groupfilter>
    </modules>
</config>

Is it not possible to do this? Am I missing something?