1

I have trouble figuring out whats wrong with my rewrite. I have used the answer of this question as a reference.

I'm trying to rewrite the core block:

app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Header.php

Here's my module's config.xml:

<config>
<modules>
    <MyNameSpace_MyModule>
        <version>1.0.0</version>
    </MyNameSpace_MyModule>
</modules>

<global>
    <blocks>
        <Adminhtml>
            <rewrite>
                <Sales_Order_Create_Header>MyNameSpace_MyModule_Block_Header</Sales_Order_Create_Header> 
            </rewrite>
        </Adminhtml>
    </blocks>
</global>

This is the path to my block where i want to rewrite the function in Header.php:

app\code\local\MyNameSpace\MyModule\Block\Header.php

Content of Header.php:

<?php

class MyNameSpace_MyModule_Block_Header extends Mage_Adminhtml_Block_Sales_Order_Create_Header {
    //My rewrite
}
  • try lowercase in your config.xml in tags <Adminhtml> and <Sales_Order_Create_Header> – Piyush Jan 3 '17 at 14:17
1

Try this code in your config.xml

<global>
    <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_create_header>MyNameSpace_MyModule_Block_Header</sales_order_create_header> 
            </rewrite>
        </adminhtml>
    </blocks>
</global>

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.