Question

Hi trying to get 2 extensions to work in the Sales Order Grid, Amasty's Mass Order Actions and Orders2CSV.

As it stands Orders2CSV is on the list and works fine. It has the following code to overwrite the Sales_Order_Grid:

    <?php
/**
 * Ext4mage Orders2csv Module
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to Henrik Kier <info@ext4mage.com> so we can send you a copy immediately.
 *
 * @category   Ext4mage
 * @package    Ext4mage_Orders2csv
 * @copyright  Copyright (c) 2012 Ext4mage (http://ext4mage.com)
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 * @author     Henrik Kier <info@ext4mage.com>
 * */ class Ext4mage_Orders2csv_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid {  const XPATH_CONFIG_SETTINGS_IS_ACTIVE       = 'orders2csv/settings/is_active';

    protected function _prepareMassaction()     {
        parent::_prepareMassaction();
        if (Mage::getStoreConfig(self::XPATH_CONFIG_SETTINGS_IS_ACTIVE)) {

            $this->getMassactionBlock()->addItem('orders2csv', array(
                 'label'=> Mage::helper('sales')->__('Orders2CSV'),
                 'url'  => $this->getUrl('*/sales_order_orders2csv/makecsv'),
            ));
        }     } } ?>

However MassActions has the following which I belive instead of overwriting the orignal block it is adding to it:

<?php
/**
* @author Amasty Team
* @copyright Copyright (c) 2010-2011 Amasty (http://www.amasty.com)
* @package Amasty_Oaction
*/
class Amasty_Oaction_Block_Adminhtml_Widget_Grid_Massaction extends Mage_Adminhtml_Block_Widget_Grid_Massaction
{
    public function isAvailable()
    {
        Mage::dispatchEvent('am_grid_massaction_actions', array(
            'block' => $this,
            'page'  => $this->getRequest()->getControllerName(),
        ));  

        return parent::isAvailable();
    }    

    public function getJavaScript()
    {
        $result = new Varien_Object(array(
            'js'   => parent::getJavaScript(),
            'page' => $this->getRequest()->getControllerName(),
        ));        

        Mage::dispatchEvent('am_grid_massaction_js', array('result' => $result));

        return $result->getJs();
    }
}

Any idea how to add the MassAction code into the Orders2CSV code?

Any help would be greatly appreciated

Andy

No correct solution

OTHER TIPS

Would be helpful if you could also add the config.xml.

If both modules are definitely rewriting (rewrite-XML-Tag in config.xml) you have to change one of the extensions to rewrite the other one, so you have some kind of chained-rewrites. You could do this in local scope to not overwrite any files in community folder.

As you see there is no conflicts, as one extension rewrites this class:

Mage_Adminhtml_Block_Sales_Order_Grid

and the second one rewrites the following class:

Mage_Adminhtml_Block_Widget_Grid_Massaction

Probably all you need is to enable actions in the module settings.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top