我想在命令中增加一个专栏。 假设客户群Id。
I app/etc/modules/My Project_ Adminhtml
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Adminhtml>
<active>true</active>
<codePool>local</codePool>
<depends>
<Mage_Sales />
</depends>
</MyProject_Adminhtml>
</modules>
</config>
I app/code/ local/Myproject/Adminhtml/etc/config.xml looks:
<?xml version="1.0"?>
<config>
<modules>
<MyProject_Adminhtml>
<version>1.0.0</version>
</MyProject_Adminhtml>
</modules>
<global>
<blocks>
<adminhtml>
<rewrite>
<sales_order_grid>MyProject_Adminhtml_Block_Sales_Order_Grid</sales_order_grid>
</rewrite>
</adminhtml>
</blocks>
</global>
</config>
而且,见附录/编码/当地/男性项目/Adminhtml/Block/Sales/Order/Grid.php。 页: 1
class MyProject_Adminhtml_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid
{
protected function _prepareColumns()
{
.... unchanged code from Mage_Adminhtml_Block_Sales_Order_Grid::_prepareColumns ...
$this->addColumn( customer_group_id , array(
header => Mage::helper( sales )->__( Customer Group Id ),
index => customer_group_id ,
type => text ,
));
.... unchanged code from Mage_Adminhtml_Block_Sales_Order_Grid::_prepareColumns ...
}
}
是否有人失踪,因为我看不到《命令》中的任何内容。 我正在使用Magento 1.4.1.1。
On Anda B 评论一写道:
var_dump($this->getLayout()->createBlock( MyProject_Adminhtml_Block_Sales_Order_Grid ));
页: 1
之后,我选择了新命令和Cancel的顺序,以了解执行var的结果。
/var/www/magento/var/report/72990635: line 10: syntax error near unexpected token `} /var/www/magento/var/report/72990635: line 10: `#9 {main}";s:3:"url";s:80:"/index.php/admin/sales_order_create/cancel/key/0624033594dd63d9e145fc538f4c6bbb/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:5:"admin";}