I have an extension of order attachment installed in my magento 1.7. What I need to do is to have an option in mass action of order grid to print order attachment. How can I do that?
1 Answer
Add this in your config.xml
<events>
<core_block_abstract_prepare_layout_before>
<observers>
<yourmodulename_core_block_abstract_prepare_layout_before>
<class>yourmodulename/observer</class>
<method>addMassAction</method>
</yourmodulename_core_block_abstract_prepare_layout_before>
</observers>
</core_block_abstract_prepare_layout_before>
</events>
your observer function
public function addMassAction($observer)
{
$block = $observer->getEvent()->getBlock();
if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
&& $block->getRequest()->getControllerName() == 'sales_order')
{
$block->addItem('myname', array(
'label' => 'myname',
'url' => Mage::app()->getStore()->getUrl('module/index/order'),
'target' => '_blank'
));
}
}
-
What will be the controller name and code? Can you provide full code.– user9748Apr 22, 2015 at 10:14
-
where you find the difficulty mention it.. i will try to help you Apr 22, 2015 at 10:21
-