【发布时间】:2015-04-22 07:39:42
【问题描述】:
我在订单网格中添加到带有优惠券代码的列时遇到问题。我在http://www.atwix.com/magento/customize-orders-grid/ 上使用了教程。
我将 Grid.php 从 /app/code/core/Mage/Adminhtml/Block/Sales/Order/ 复制到 /app/code/local/Mage/Adminhtml/Block/Sales/Order/ 并添加了以下代码:
$select->join('sales_flat_order', '`sales_flat_order`.entity_id = `main_table`.entity_id',array('coupon_code'))
到函数_prepareCollection() 并在函数_prepareColumns() 中添加列:
$this->addColumn('coupon_code', array(
'header' => Mage::helper('sales')->__('Coupon Coded'),
'index' => 'coupon_code'
));
但在管理员页面上的销售/订单上没有显示任何内容。有谁知道什么时候可能是问题?
感谢您的意见/想法。
【问题讨论】:
-
你的代码是对的,检查app/etc/local.xml中是否启用了本地模块并尝试清空缓存
-
谢谢。它可能是缓存,现在是一个带有优惠券代码的新列,但如果我按特定订单排序。告诉我这个错误 SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'increment_id' in where 子句不明确