开发者

Add new Action to invoice's ActionList

开发者 https://www.devze.com 2023-01-01 01:44 出处:网络
I need to add a new action to the ActionList in the Invoices page I don\'t know where magento creates this list and how it call the selected action, so I thought you guys would know where I should sta

I need to add a new action to the ActionList in the Invoices page

I don't know where magento creates this list and how it call the selected action, so I thought you guys would know where I should start looking...

T开发者_高级运维hanks!

Jonathan


The class you want to override is Mage_Adminhtml_Block_Sales_Invoice_Grid. Copy that file into the local space (so you'll have app/code/local/Mage/Adminhtml/Block/Sales/Invoice/Grid.php) and then modify the following function:

protected function _prepareMassaction()
{
    $this->setMassactionIdField('entity_id');
    $this->getMassactionBlock()->setFormFieldName('invoice_ids');

    $this->getMassactionBlock()->addItem('pdfinvoices_order', array(
         'label'=> Mage::helper('sales')->__('PDF Invoices'),
         'url'  => $this->getUrl('*/*/pdfinvoices'),
    ));

    // your action goes here
    $this->getMassactionBlock()->addItem('handle', array(
         'label'=> Mage::helper('sales')->__('Your Action Label'),
         'url'  => $this->getUrl('path/to/your/action'),
    ));  

    return $this;
}

Hope that helps!

Thanks, Joe

0

精彩评论

暂无评论...
验证码 换一张
取 消