您好我想在销售订单网格中显示一些自定义客户地址属性。
如何实现?
下面是我的收藏。我已经成功添加了另一个表中的表字段,但无法从客户/地址添加属性
protected function _prepareCollection()
{
$collection = Mage::getResourceModel('sales/order_grid_collection');
$collection->getSelect()->joinLeft(array('sfoa'=>'sales_flat_order_address'),
'main_table.entity_id = sfoa.parent_id AND sfoa.address_type="shipping"',array('sfoa.street', 'sfoa.city','sfoa.company','sfoa.customer_address_id'));
$collection->addFieldToFilter('customer_id', Mage::registry('current_customer')->getId())
->setIsCustomerMode(true);
Mage::log($collection);
$this->setCollection($collection);
return parent::_prepareCollection();
}
谢谢你们。
答案 0 :(得分:0)
Anurag Patbandha
根据您的代码,您只能添加sales_flat_order_address
字段。
如果您要将customer address attribute to order grid then you need join
添加到customer/address
集合on default shipping or billing address