【发布时间】:2016-11-15 09:20:59
【问题描述】:
我想从 Magento 管理员端删除列 Group。
我尝试了以下方法,但没有奏效:
$this->removeColumn('group');
请指教。
【问题讨论】:
标签: magento
我想从 Magento 管理员端删除列 Group。
我尝试了以下方法,但没有奏效:
$this->removeColumn('group');
请指教。
【问题讨论】:
标签: magento
转到这个文件路径:app/code/core/Mage/Adminhtml/Block/Customer/Grid.php
并添加以下代码以从 Magento 管理客户网格中删除组列。
$this->addColumn('group', array(
'header' => Mage::helper('customer')->__('Group'),
'width' => '100',
'index' => 'group_id',
'type' => 'options',
'options' => $groups,
));
【讨论】:
为此,您可以查看以下文件:
app\code\core\Mage\Adminhtml\Block\Customer\Grid.php
如果您将此文件复制到本地文件夹会更好,这样在任何 Magento 升级时您的自定义都不会被撤消。
app\code\local\Mage\Adminhtml\Block\Customer\Grid.php
在此您将看到以下代码:
/* $groups = Mage::getResourceModel('customer/group_collection')
->addFieldToFilter('customer_group_id', array('gt'=> 0))
->load()
->toOptionHash();
$this->addColumn('group', array(
'header' => Mage::helper('customer')->__('Group'),
'width' => '100',
'index' => 'group_id',
'type' => 'options',
'options' => $groups,
));
*/
只要注释掉这段代码就可以了。
【讨论】: