将新操作添加到发票的ActionList

我需要在Invoices页面的ActionList中添加一个新动作 我不知道magento在哪里创建这个列表以及它如何调用所选择的动作,所以我想你们都知道我应该从哪里开始寻找...... 谢谢! 乔纳森     
已邀请:
要覆盖的类是
Mage_Adminhtml_Block_Sales_Invoice_Grid
。将该文件复制到本地空间(这样你就有了
app/code/local/Mage/Adminhtml/Block/Sales/Invoice/Grid.php
)然后修改以下函数:
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;
}
希望有所帮助! 谢谢, 乔     

要回复问题请先登录注册