MagentoバックエンドShip
の画面のボタンのアクションを変更するにはどうすればよいですか?Order view
上の画像は、Ship
私が意味するボタンを表しています。私はそれを私自身のコントローラー/私自身のモジュールのアクションに向けたいと思います。モジュールを壊さずにMagentoをアップグレードできるように、これをできるだけクリーンにしたいと思います。
1692 次
1 に答える
2
書き換えるカスタムモジュールを作成してみてくださいMage_Adminhtml_Block_Sales_Order_View
config.xml:
<global>
<blocks>
<adminhtml>
<rewrite>
<sales_order_view>Namespace_Module_Block_Adminhtml_Sales_Order_View</sales_order_view>
</rewrite>
</adminhtml>
</blocks>
</global>
名前空間/モジュール/ブロック/Adminhtml/Sales/Order/View.php:
class Namespace_Module_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
public function getShipUrl()
{
//add your custom url
return $this->getUrl('*/sales_order_shipment/start');
}
}
/app/code/core/Mage/Adminhtml/Block/Sales/Order/View.phpを参照してください
続きを読む@Magento管理パネルの注文ビューに新しいボタンを追加する方法は?
タイトルの更新も変更したい場合
if ($this->_isAllowedAction('ship') && $order->canShip()
&& !$order->getForcedDoShipmentWithInvoice()) {
$this->_addButton('order_ship', array(
'label' => Mage::helper('sales')->__('Ship'),
'onclick' => 'setLocation(\'' . $this->getShipUrl() . '\')',
'class' => 'go'
));
}
于 2013-03-27T00:52:43.017 に答える