0

I am trying to overload the core/mage/adminhtml/sales/order/grid.php Block. The Problem is, the Block is already overwritten by another Module (Raveinfosys Deleteorder). So i have to try, to overload the grid.php of the local Module Deleteorder... but it doesnt work... :(

Thats what i try last:

etc/config.xml

<config>
<modules>
    <company_modulename>
        <version>0.0.1</version>
        <depends>
            <Mage_Adminhtml />
            <Raveinfosys_Deleteorder />
        </depends>
    </company_modulename>
</modules>
<global>
    <blocks>
        <deleteorder>
            <rewrite>
                <sales_order_grid>Company_Modulename_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
            </rewrite>
        </deleteorder>  
    </blocks>     
</global> 

Block/Adminhtml/Sales/Order/Grid.php

class Company_Modulename_Block_Adminhtml_Sales_Order_Grid extends Raveinfosys_Deleteorder_Block_Adminhtml_Sales_Order_Grid
{
    protected function _prepareColumns()
    {
        .....
    }
}

UPDATE

But how can i manually manage the hierarchy when i am not able to rewrite the custom module file? i need to rewrite the deleteorder class, because that on is rewriting the core file.

i want to do: myClass extends deleteorderClass, deleteorderClass extends coreClass (without changing the deleteorder module files)

1

You'll have to manually manage the hierarchy in the block php files. Class A extends B, B extends C, etc.

0

If you rewrite the main Mage_Adminhtml block then you can simply extends the other modules block and this should give you the desired results.

<adminhtml>
    <rewrite>
        <sales_order_grid>Company_Modulename_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
    </rewrite>
</adminhtml>

The problem with using <deleteorder> and trying to rewrite that is it is never called as it rewrites the <adminhtml> section.

Note: You then have to be careful when trying to get the code from the two blocks working together

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.