title: Magento - Add Mass Action to Sales > Orders Grid
body: <p><strong>Edit 4/4/12</strong></p>
  
  <p><strong>I STILL HAVE ONE QUESTION:</strong></p>
  
  <p>I solved my issue but it adds my option at the top of the list. How can I sort it to my my option to the <strong>bottom</strong> of the list?</p>
  
  <p>Please see answer for contents of my working <code>config.xml</code> file...</p>
  
  <hr>
  
  <p>I'm looking for in depth help here because I've been at this for quite a while now and seem to be getting nowhere.</p>
  
  <p><strong>Background</strong><br>
  I was looking to make a printable RMA form for our customers to make it easier on them to Return/Exchange items. </p>
  
  <p>I did this with the help of this extension: <a href="http://www.magentocommerce.com/magento-connect/admin-order-printing-extension.html" rel="nofollow">http://www.magentocommerce.com/magento-connect/admin-order-printing-extension.html</a><br>
  <em>(Please download this to see the directory structure if needed)</em></p>
  
  <p>It adds a button to the order and then I went in and edited the form/form layout so that it was an RMA (or has RMA content).</p>
  
  <p>Everything is working great, however, we have to go into each order and press the button in order for it to print.</p>
  
  <p>We really need a <code>Mass Action</code> in order to make it more efficient and useful. </p>
  
  <p><strong>Problem</strong><br>
  I've tried to different ways to get this to work but I really need help on this. Most recently I've tried to follow this tutorial (http://www.blog.magepsycho.com/adding-new-mass-action-to-admin-grid-in-magento/) using the second method of <code>events</code> but I can't seem to get this to work.</p>
  
  <p>Can someone please explain in more depth (this last method I've tried) so that I can get it working with this module???</p>
  
  <p>I've added this in the <code>config.xml</code>(according to the tutorial)</p>
  
  <pre><code>&lt;events&gt;
      &lt;core_block_abstract_prepare_layout_before&gt;
          &lt;observers&gt;
              &lt;orderprint_core_block_abstract_prepare_layout_before&gt;
                   &lt;class&gt;orderprint/observer&lt;/class&gt;
                   &lt;method&gt;addRmaAction&lt;/method&gt;
              &lt;/orderprint_core_block_abstract_prepare_layout_before&gt;
          &lt;/observers&gt;
      &lt;/core_block_abstract_prepare_layout_before&gt;
   &lt;/events&gt;
  </code></pre>
  
  <p>And in <code>Nastnet/OrderPrint/Model/Observer.php</code> I've added this (according to the tutorial)</p>
  
  <pre><code>&lt;?php class Nastnet_OrderPrint_Model_Observer {
  public function addRmaAction($observer) {
      $block = $observer-&gt;getEvent()-&gt;getBlock();
      if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
          &amp;&amp; $block-&gt;getRequest()-&gt;getControllerName() == 'sales_order')
      {
          $block-&gt;addItem('pdfrma_order', array(
              'label' =&gt; 'Print RMA',
              'url' =&gt; Mage::app()-&gt;getStore()-&gt;getUrl('nastnet/controller/action'),
          ));
      }
  } }
  </code></pre>
  
  <p><em>(Sorry for the messy code above - the only way I could get it highlighted)</em></p>
  
  <p><strong>EDIT 1 (4/2/12)</strong>
  This is my module's config.xml file. I've had to go with the rewrite/override method as of right now (deleting my attempts at using events). If you see anything, including the exact structure of what it would need to be please let me know...</p>
  
  <p>Minus the <code>&lt;config&gt;</code> tags:</p>
  
  <pre><code>&lt;modules&gt;
      &lt;Nastnet_OrderPrint&gt;
          &lt;version&gt;0.1.3&lt;/version&gt;
      &lt;/Nastnet_OrderPrint&gt;
  &lt;/modules&gt;
  
  &lt;global&gt;
      &lt;blocks&gt;
          &lt;adminhtml&gt;
              &lt;rewrite&gt;
                  &lt;sales_order_grid&gt;Nastnet_OrderPrint_Block_Sales_Order_Grid&lt;/sales_order_grid&gt; &lt;!-- WORKIING METHOD --&gt;
                  &lt;sales_order_view&gt;Nastnet_OrderPrint_Block_Sales_Order_View&lt;/sales_order_view&gt;
              &lt;/rewrite&gt;
          &lt;/adminhtml&gt;
      &lt;/blocks&gt;
      &lt;rewrite&gt;
          &lt;Nastnet_OrderPrint_OrderController&gt;
              &lt;from&gt;&lt;![CDATA[#/\w+/sales_order/print/#]]&gt;&lt;/from&gt;
              &lt;to&gt;/orderprint/order/print/&lt;/to&gt;
          &lt;/Nastnet_OrderPrint_OrderController&gt;
      &lt;/rewrite&gt;
      &lt;models&gt;
          &lt;Nastnet_OrderPrint&gt;
              &lt;class&gt;Nastnet_OrderPrint_Model&lt;/class&gt;
          &lt;/Nastnet_OrderPrint&gt;
      &lt;/models&gt;
      &lt;pdf&gt;
          &lt;order&gt;
              &lt;default&gt;Nastnet_OrderPrint/order_pdf_items_order_default&lt;/default&gt;
              &lt;grouped&gt;Nastnet_OrderPrint/order_pdf_items_order_grouped&lt;/grouped&gt;
          &lt;/order&gt;
      &lt;/pdf&gt;
  &lt;/global&gt;
  &lt;admin&gt;
      &lt;routers&gt;
          &lt;Nastnet_OrderPrint&gt;
               &lt;use&gt;admin&lt;/use&gt;
              &lt;args&gt;
                  &lt;module&gt;Nastnet_OrderPrint&lt;/module&gt;
                  &lt;!-- This is used when "catching" the rewrite above --&gt;
                  &lt;frontName&gt;orderprint&lt;/frontName&gt;
              &lt;/args&gt;
          &lt;/Nastnet_OrderPrint&gt;
      &lt;/routers&gt;
  </code></pre>
  
  <p></p>