2013-04-16 70 views
0

我使用HWG属性管理器为客户添加自定义属性。即IDNumber。在Magento的订单网格上显示自定义属性

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', 
    )); 

回答

0

我解决它。这只是我的错误。

这将工作:

->addAttributeToSelect('my_custom_customer_attribute_name') 
相关问题