dongsi1944 2014-07-29 13:08
浏览 34
已采纳

Magento为后端订单视图添加了2个按钮

I'm trying to add 2 buttons to the magento(1.8.1) order view backend page. The last one(afhaalmail) is showing up and the first one isnt. When i comment out the second button only the first one is showing up.

Any help would be appreciated.

class Web4u_DropshipPackinslip_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
public function  __construct() {
    parent::__construct();


    $this->_addButton('button_id2', array(
        'label'     => 'Pakbon Dropship',
        'onclick'   => 'setLocation(\'' . $this->getNewProductReturnUrl() . '\')',
        'class'     => 'go2'
    ), 0, 100, 'header', 'header');

    $this->_addButton('afhaalmail', array(
        'label'     => 'Afhaalmail versturen',
        'onclick'   => 'setLocation(\'' . $this->getNewProductReturnUrl() . '\')',
        'class'     => 'go'
    ), 0, 100, 'header', 'header');



}

 public function getNewProductReturnUrl()
{

    return $this->getUrl('afhaalmail/adminhtml_afhaalmailbackend/index', array('order_id' => mage::registry('sales_order')->getId()));
    //return $this->getUrl('dropshippackinslip/adminhtml_DropshipPackinslipbackend/index', array('order_id' => mage::registry('sales_order')->getId()));
}

}

  • 写回答

1条回答 默认 最新

  • donglin9068 2014-07-29 13:28
    关注

    In Mangeto

    addButton($id, $data, $level = 0, $sortOrder = 0, $area = 'header');
    

    you are using same Sortorder in both buttons so please use the different - different sort order like:-

    $this->_addButton('button_id2', array(
        'label'     => 'Pakbon Dropship',
        'onclick'   => 'setLocation(\'' . $this->getNewProductReturnUrl() . '\')',
        'class'     => 'go2'
    ), 0, 100, 'header', 'header');
    
    $this->_addButton('afhaalmail', array(
        'label'     => 'Afhaalmail versturen',
        'onclick'   => 'setLocation(\'' . $this->getNewProductReturnUrl() . '\')',
        'class'     => 'go'
    ), 0, 150, 'header', 'header');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办