Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Magento 1.9销售订单视图的简单按钮_Php_Magento - Fatal编程技术网

Php Magento 1.9销售订单视图的简单按钮

Php Magento 1.9销售订单视图的简单按钮,php,magento,Php,Magento,我想在Magento订单中添加一个简单的按钮。我尝试了stackoverflow的解决方案,但不起作用。这是我的代码,如果你能告诉我我做错了什么就好了。多谢各位 app/local/FirstGood/PrintCard/Block/Adminhtml/Sales/Order/View.php 您只需要使用“sales”助手,而不是“xxx”。使用下面的代码,这将有助于解决这个问题 app/local/FirstGood/PrintCard/Block/Adminhtml/Sales/Order

我想在Magento订单中添加一个简单的按钮。我尝试了stackoverflow的解决方案,但不起作用。这是我的代码,如果你能告诉我我做错了什么就好了。多谢各位

app/local/FirstGood/PrintCard/Block/Adminhtml/Sales/Order/View.php
您只需要使用“sales”助手,而不是“xxx”。使用下面的代码,这将有助于解决这个问题

app/local/FirstGood/PrintCard/Block/Adminhtml/Sales/Order/View.php

<?
class FirstGood_PrintCard_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
    public function  __construct() {

       parent::__construct();
       $this->addButton('button_id', array(
        'label'     => Mage::helper('sales')->__('Some action'),
        'onclick'   => 'jsfunction(this.id)',
        'class'     => 'go'
       ), 0, 100, 'header', 'header');
    }
}
您只需要使用“sales”助手,而不是“xxx”。使用下面的代码,这将有助于解决这个问题

app/local/FirstGood/PrintCard/Block/Adminhtml/Sales/Order/View.php

<?
class FirstGood_PrintCard_Block_Adminhtml_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View {
    public function  __construct() {

       parent::__construct();
       $this->addButton('button_id', array(
        'label'     => Mage::helper('sales')->__('Some action'),
        'onclick'   => 'jsfunction(this.id)',
        'class'     => 'go'
       ), 0, 100, 'header', 'header');
    }
}

谢谢,这似乎是个错误,但它仍然没有显示按钮。但我认为,这是因为其他扩展已经在这里添加了按钮/操作按钮。但是,如果我在核心文件中更改它,它的工作。。。我真的不明白为什么这么简单的东西又一次不能与magento一起工作。更改核心文件不是一个好主意,请尽量避免。然而,当我尝试你的代码时,它对我非常有效。可能是缓存问题,请尝试清除该问题并重新启用此模块。您打算在何处重新启用它?在后端?缓存已停用,并且已被清除数十次。我的意思是禁用您的模块,然后从系统->配置->高级->高级选项卡再次启用它。我也经常这样做,该按钮会出现在“销售>订单>订单详细信息”下?有什么能让它不发生呢。否则我将需要使用核心解决方案。谢谢,这似乎是一个错误,但它仍然没有显示按钮。但我认为,这是因为其他扩展已经在这里添加了按钮/操作按钮。但是,如果我在核心文件中更改它,它的工作。。。我真的不明白为什么这么简单的东西又一次不能与magento一起工作。更改核心文件不是一个好主意,请尽量避免。然而,当我尝试你的代码时,它对我非常有效。可能是缓存问题,请尝试清除该问题并重新启用此模块。您打算在何处重新启用它?在后端?缓存已停用,并且已被清除数十次。我的意思是禁用您的模块,然后从系统->配置->高级->高级选项卡再次启用它。我也经常这样做,该按钮会出现在“销售>订单>订单详细信息”下?有什么能让它不发生呢。否则,我将需要使用核心解决方案。