Jump to content

Backend - Add group in customers list


jacksfregio

Recommended Posts

Create override/controllers/admin/AdminCustomersController.php with the following:

<?php

class AdminCustomersController extends AdminCustomersControllerCore
{
    public function __construct()
    {
        parent::__construct();
        
        $this->_select .= ', g.`name` as group_name';
        $this->_join .= '
            LEFT JOIN `'._DB_PREFIX_.'customer_group` cg ON (a.`id_customer` = cg.`id_customer`)
            LEFT JOIN `'._DB_PREFIX_.'group_lang` g ON (cg.`id_group` = g.`id_group` AND g.`id_lang` = '.
            (int)$this->context->language->id.')';
        
        $this->fields_list['group_name'] = array('title' => $this->l('Group'));   
    }
}

This will add a new "Group" column to the Customers tab. Don't forgot to go to Advanced Parameters > Performance and click "Clear cache".

Link to comment
Share on other sites

  • 2 years later...
  • 9 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...