0

I have modified

app/design/adminhtml/default/default/template/sales/order/view/items/renderer/default.phtml

what is the quick process to overwrite the page?thanks

3
  • 2
    Not sure what are you asking.
    – user487772
    Sep 10, 2013 at 10:40
  • You want to have a second directory next to the adminhtml/default/default directory, Something like adminhtml/default/custom/ ? Sep 10, 2013 at 10:52
  • yes @SanderMangel actually i have modified above link of the page. is it necessary to overwrite it? Sep 10, 2013 at 10:58

1 Answer 1

1

To add a second templating directory to the adminhtml, for example: app/design/adminhtml/default/custom/ you'll have to modify the following file app/code/core/Mage/Adminhtml/Block/Template.php

add the following __construct method

public function __construct()
{
    Mage::getDesign()->setTheme('custom');
}

This will set the custom directory as primary templating directory and default as fallback

Of course it's better to overwrite it from your own extension. Create a class that extends the Mage_Adminhtml_Block_Template class with just that constructor and add the following to your config.xml

[...]
<global>
    <blocks>
        <customextension>
            <class>Your_Customextension_Block</class>
        </customextension>
        <adminhtml>
            <rewrite>
                <!-- allow for extra layer of adminhtml templating -->
                <template>Your_Customextension_Block_Mage_Adminhtml_Template</template>
            </rewrite>
        </adminhtml>
    </blocks>
</global>
[...]
4
  • Create a class or module? Sep 10, 2013 at 11:22
  • it's a block class that you're creating in your own extension Sep 10, 2013 at 11:22
  • to extend Mage_Adminhtml_Block_Template class i have to create one module. right? and config file i have to write your code which u have written above. Sep 10, 2013 at 11:28
  • 1
    Yes that is correct. Either that or modify the core class but writing your own module or extension is prefered Sep 10, 2013 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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