如何在Magento Enterprise的“管理客户视图”中显示新添加的Customer属性

时间:2011-12-01 11:55:59

标签: magento

我在Magento Enterprise版的同一个安装中安装了三个商店。

我创建了一个额外的客户属性,它确实成功地出现在前端。但我想在管理员的“管理客户视图”中显示此属性,以便我可以使用此属性来过滤我的客户记录。

但它没有显示出其他属性。我该如何实现这一目标?

2 个答案:

答案 0 :(得分:3)

创建了一个自定义模块,该模块超越了Mage / Adminhtml / Block / Customer / Grid.php并修改了以下功能。由于我想添加一个列,这是我客户的帐单信息的一部分,我的代码看起来像这样。

public function setCollection($collection)
{
    $collection->joinAttribute('your_column', 'customer_address/your_column', 'default_billing', null, 'left');                   
    parent::setCollection($collection);
}

$this->addColumn('Company', array(
        'header'    => Mage::helper('customer')->__('Your column'),
        'index'     => 'your_column',
        'type'      => 'text',
        //'renderer' => 'ConstantMedia_Adminhtml_Block_Render_Confirmation',

    ));

您可以根据自己的要求调整代码。希望这有帮助!

答案 1 :(得分:1)

一种方法是扩展:

Mage_Adminhtml_Block_Customer_Grid

位于:

app/code/core/Mage/Adminhtml/Block/Customer/Grid.php

并在_prepareColumns()

中添加您的专栏