I created a module using the module creator.
I am trying to overwrite Adminhtml\Block\Sales\Order\Grid.php
class Mage_Adminhtml_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
and my overwritten block is in local\Delivery\Date\Block\Sales\Order\Grid.php
class Delivery_Date_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
and the function to overwrite is
protected function _prepareColumns()
{
I face a strange problem when I try to overwrite a function in my module Block the change are not affected instead if I comment out the same function lines in the Mage folder my function is overwritten.
Suppose i have a function in local\Delivery\Date\Block\Sales\Order\Grid.php as
protected function _prepareColumns()
{
$this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order NEW ID#'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
));}
noting happens instead if I comment/delete the line in Adminhtml\Block\Sales\Order\Grid.php
protected function _prepareColumns()
{
$this->addColumn('real_order_id', array(
'header'=> Mage::helper('sales')->__('Order #'),
'width' => '80px',
'type' => 'text',
'index' => 'increment_id',
));
Then only my changes are affected in the adminhtml grid. Why is the fallback changes happening ?
config.xml
<blocks>
<adminhtml>
<rewrite>
<sales_order_grid>Delivery_Date_Block_Sales_Order_Grid</sales_order_grid>
</rewrite>
</adminhtml>
</blocks>