Note that there are some explanatory texts on larger screens.

plurals
  1. POBlock Overriding adminhtml function overrides instead - Magento
    primarykey
    data
    text
    <p>I created a module using the module creator. </p> <p>I am trying to overwrite Adminhtml\Block\Sales\Order\Grid.php</p> <pre><code>class Mage_Adminhtml_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid </code></pre> <p>and my overwritten block is in local\Delivery\Date\Block\Sales\Order\Grid.php</p> <pre><code>class Delivery_Date_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid </code></pre> <p>and the function to overwrite is</p> <pre><code>protected function _prepareColumns() { </code></pre> <p>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.</p> <p>Suppose i have a function in local\Delivery\Date\Block\Sales\Order\Grid.php as</p> <pre><code>protected function _prepareColumns() { $this-&gt;addColumn('real_order_id', array( 'header'=&gt; Mage::helper('sales')-&gt;__('Order NEW ID#'), 'width' =&gt; '80px', 'type' =&gt; 'text', 'index' =&gt; 'increment_id', ));} </code></pre> <p>noting happens instead if I comment/delete the line in Adminhtml\Block\Sales\Order\Grid.php</p> <pre><code>protected function _prepareColumns() { $this-&gt;addColumn('real_order_id', array( 'header'=&gt; Mage::helper('sales')-&gt;__('Order #'), 'width' =&gt; '80px', 'type' =&gt; 'text', 'index' =&gt; 'increment_id', )); </code></pre> <p>Then only my changes are affected in the adminhtml grid. Why is the fallback changes happening ?</p> <p>config.xml</p> <pre><code>&lt;blocks&gt; &lt;adminhtml&gt; &lt;rewrite&gt; &lt;sales_order_grid&gt;Delivery_Date_Block_Sales_Order_Grid&lt;/sales_order_grid&gt; &lt;/rewrite&gt; &lt;/adminhtml&gt; &lt;/blocks&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload