I’ve followed all the tutorials I could find on ‘adding a mass action’
example of this: http://www.smit-web.nl/magento-mass-actions-using-observers/
But there is something I don’t understand (and more people don’t) but I can’t find the answer.
This tutorials place the mass action in the drop down. But how do I get the action and do whatever I want to do?
For example, my config.xml has this:
<gridexample>
<type>singleton</type>
<!-- Observer location (e.g. SW/GridExample/Model) -->
<class>SW_GridExample_Model_Observer</class>
<!-- Function to call -->
<method>addActions</method>
</gridexample>
This function: “addActions” I find in the observer. But then I’m stuck.
In the observer it says:
$block->addItem('demo', array(
'label' => Mage::helper('sales')->__('Example'),
'url' => $block->getUrl('*/*/'),
)
);
But then what? The label ‘Example’ is available in the drop down, but what do I do next? How can I get the ids and where do I have my actions take place if the action Example is selected?
If you’re trying to add a mass action to your own module, follow this tutorial:
http://inchoo.net/ecommerce/magento/how-to-add-massactions-to-magentos-grid/
The tutorial you’re using is to add a mass action to already existing modules. Let me know if you still have questions.