0

Sales order gridHow to add the new mass action in magento sales order grid to update my custom status.

1 Answer 1

0

your config.xml for event calling

<events>
            <core_block_abstract_prepare_layout_before>
                <observers>
                    <modulename>
                        <class>modulename/observer</class>
                        <method>addActions</method>
                    </modulename>
                </observers>
            </core_block_abstract_prepare_layout_before>
        </events>

your observer function

class Spacename_Moudlename_Model_Observer
{
    public function addActions($observer)
        {



         $block = $observer->getEvent()->getBlock();
                if(get_class($block) =='Mage_Adminhtml_Block_Widget_Grid_Massaction'
                    && $block->getRequest()->getControllerName() == 'sales_order')
                {


                    $block->addItem('--Your Label--', array(
                        'label' => '--Your Label--' ,
                        'url' => '',
                        'target'    => '_blank'
                    ));

              }

    }}
8
  • In which config.xml and observer function can i add the given code. @Qaisar Satti Nov 5, 2015 at 12:52
  • your module config.xml or you want to add directly?? Nov 5, 2015 at 12:54
  • Where i mention the action? Nov 5, 2015 at 12:58
  • if you asking about the massaction url you can add it 'url' => 'your post action url', Nov 5, 2015 at 13:00
  • I'm not sure that's the right event to observe
    – scrowler
    Nov 5, 2015 at 19:06

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.