我使用 HWG 属性管理器向客户添加自定义属性。即身份证号码。
http://www.magentocommerce.com/magento-connect/custom-attributes-4340.html
因此,如果客户下了订单,在管理员的订单网格中,我想获取此属性。我在执行此操作时遇到问题。有没有人试过这个?
添加的属性在customer_entity_varchar
数据库中。
我试过这个,
protected function _prepareCollection()
{
$collection = Mage::getResourceModel('customer/customer_collection')
->addNameToSelect()
->addAttributeToSelect('email')
->addAttributeToSelect('created_at')
->addAttributeToSelect('group_id')
->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing', null, 'left')
->joinAttribute('billing_city', 'customer_address/city', 'default_billing', null, 'left')
->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing', null, 'left')
->joinAttribute('billing_region', 'customer_address/region', 'default_billing', null, 'left')
->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing', null, 'left');
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$this->addColumn('entity_id', array(
'header' => Mage::helper('customer')->__('ID'),
'width' => '50px',
'index' => 'entity_id',
'type' => 'number',
));
$this->addColumn('Admin Number', array(
'header' => Mage::helper('customer')->__('Admin Number'),
'width' => '100',
'index' => 'entity_id',
));