【发布时间】:2010-05-27 13:59:12
【问题描述】:
我需要在发票页面的 ActionList 中添加一个新操作
我不知道 magento 在哪里创建此列表以及它如何调用所选操作,所以我想你们会知道我应该从哪里开始查找...
谢谢!
乔纳森
【问题讨论】:
我需要在发票页面的 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;
}
希望有帮助!
谢谢, 乔
【讨论】: