2

I am trying to override the shipping method in the Edit order area of the admin side.

What I have done is, added new file

My/Module/Block/Adminhtml/Sales/Order/Create/Shipping/Method/Form/Form.php in my custom module. It has code,

<?php
class My_Module_Block_Adminhtml_Sales_Order_Create_Shipping_Method_Form extends Mage_Adminhtml_Block_Sales_Order_Create_Shipping_Method_Form
{
    protected function _toHtml(){
        $this->setTemplate('module/form.phtml');
        return parent::_toHtml();
    }
}
?>

and in my config.xml ,

<blocks>
        <adminhtml>
            <rewrite><sales_order_create_shipping_method_form>My_Module_Block_Adminhtml_Sales_Order_Create_Shipping_Method_Form</sales_order_create_shipping_method_form>
            </rewrite>
        </adminhtml>
     </blocks>

in frontend/adminhtml/default/default/template/module/form.phtml

I wrote

<?php echo "Hello world"; ?>

I think this is enough to override the sales_order_create_shipping_method_form. But Unfortunately, nothing happens!! Please let me know If i missed something.

Aasim Goriya
  • 5,444
  • 2
  • 28
  • 53
Vishnu R
  • 597
  • 1
  • 6
  • 21

1 Answers1

1

You have one excessive directory in a path to your block:

My/Module/Block/Adminhtml/Sales/Order/Create/Shipping/Method/Form/Form.php

What I really can't understand is by to rewrite a block when you can observe adminhtml_block_html_before event instead.

Tim Bezhashvyly
  • 11,575
  • 6
  • 43
  • 73