我想再添加一个字段,即在Order -> some part.Can中由客户订购的数量,有人在这方面帮助我。
尊敬的Vishavdeep Goyal
发布于 2014-05-14 19:58:16
我不知道您会如何选择“按客户订购的数量”,但下面的示例显示了如何在发货网格中显示total_qty_ordered字段表单sales_flat_order表:
1)将文件app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php复制到app/code/local/Mage/Adminhtml/Block/Sales/Shipment/Grid.php
2)修改_prepareCollection()方法
protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());
$collection->getSelect()->joinLeft(array('order' => Mage::getSingleton('core/resource')->getTableName('sales_flat_order')), 'main_table.entity_id = order.entity_id', 'total_qty_ordered');
$this->setCollection($collection);
return parent::_prepareCollection();
}2)修改_prepareColumns()方法和下面的代码
$this->addColumn('total_qty_ordered', array(
'header' => Mage::helper('sales')->__('Total Qty Ordered'),
'index' => 'total_qty_ordered',
'type' => 'number',
));https://stackoverflow.com/questions/23626908
复制相似问题