0

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 1

1

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'
        ));
    }



        }
3
  • What will be the controller name and code? Can you provide full code.
    – user9748
    Apr 22, 2015 at 10:14
  • where you find the difficulty mention it.. i will try to help you Apr 22, 2015 at 10:21
  • i change my code check it Apr 22, 2015 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.