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 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
  • ¥15 机器人轨迹规划相关问题
  • ¥15 word样式右侧翻页键消失