将新操作添加到发票的操作列表中

发布于 2024-09-03 01:13:01 字数 115 浏览 4 评论 0原文

我需要向发票页面的 ActionList 添加一个新操作
我不知道magento在哪里创建这个列表以及它如何调用所选的操作,所以我想你们会知道我应该从哪里开始寻找...

谢谢!
乔纳森

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...

Thanks!
Jonathan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

记忆里有你的影子 2024-09-10 01:13:01

您要覆盖的类是 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;
}

希望有帮助!

谢谢,

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文