1

請求書ページの ActionList に新しいアクションを追加する必要があります
。magento がこのリストを作成する場所と、選択したアクションを呼び出す方法がわかりません。

ありがとう!
ジョナサン

4

1 に答える 1

2

オーバーライドしたいクラスは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;
}

それが役立つことを願っています!

ありがとう、ジョー

于 2010-05-27T14:04:52.967 に答える