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

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. – user9748 Apr 22 '15 at 10:14
  • where you find the difficulty mention it.. i will try to help you – Qaisar Satti Apr 22 '15 at 10:21
  • i change my code check it – Qaisar Satti Apr 22 '15 at 10:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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