【问题标题】:How to remove `group` column from magneto admin customer grid?如何从 magento 管理客户网格中删除“组”列?
【发布时间】:2016-11-15 09:20:59
【问题描述】:

我想从 Magento 管理员端删除列 Group。 我尝试了以下方法,但没有奏效:

$this->removeColumn('group'); 

请指教。

【问题讨论】:

    标签: magento


    【解决方案1】:

    转到这个文件路径: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,
    ));
    

    【讨论】:

      【解决方案2】:

      为此,您可以查看以下文件:

      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,
          ));
      */
      

      只要注释掉这段代码就可以了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-01-08
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多