【发布时间】:2014-03-26 07:21:37
【问题描述】:
我必须在订单视图中放置一个按钮,以进一步发送订单 ID。 id 将用于简单的数据库查询,然后它应该返回到订单视图。
我发现了如何创建按钮,我在核心的 view.php 之后创建了app/code/local/Mage/Adminhtml/Block/Sales/Order/View.php。
这是我的代码:
class Mage_Adminhtml_Block_Sales_Order_View extends
Mage_Adminhtml_Block_Widget_Form_Container
{
public function __construct()
{
$this->_objectId = 'order_id';
$this->_controller = 'sales_order';
$this->_mode = 'view';
parent::__construct();
$this->_removeButton('delete');
$this->_removeButton('reset');
$this->_removeButton('save');
$this->setId('sales_order_view');
$order = $this->getOrder();
$this->_addButton('release_payment', array(
'label' => Mage::helper('sales')->__('Release Payment'),
'onclick' => 'setLocation(\'' . $this->getUrl('*/*/release') . '\')',
'class' => 'go'
));
}
我想要的是这个位置应该是 sales_order/release 以实际使用订单 ID 执行某些操作。我试图理解如何,但我无法实际创建控制器。
【问题讨论】:
标签: php magento button ecommerce-sales