Rosi Posted November 30, 2019 Share Posted November 30, 2019 Hi, What files in default backened theme I have to modify to show the group which a customer belong to in customers list in backend? I found a solution for version 1.6 but not for 1.7 Otherwise this is quite an important parameter so I wonder that the list is missing. Thanks Link to comment Share on other sites More sharing options...
EvaF Posted December 2, 2019 Share Posted December 2, 2019 (edited) override AdminCustomersController.php 1) place in in your module yourmodule/override/controllers/admin/AdminCustomersController.php with this content: <?php class AdminCustomersController extends AdminCustomersControllerCore { public function renderList() { $this->fields_list = array_merge($this->fields_list, array( 'groupname' => array( 'title' => $this->trans('Group', array(), 'Admin.Global'), 'maxlength' => 30 ) ) ); $this->_select .= ', ( SELECT gl.name FROM ' . _DB_PREFIX_ . 'customer_group g JOIN ' . _DB_PREFIX_ . 'group_lang gl on gl.id_group = g.id_group and gl.id_lang= '. (int) $this->context->language->id . ' WHERE g.id_customer = a.id_customer) as groupname '; return parent::renderList(); } } 2) install (or reinstall) your module result customer list: Edited December 2, 2019 by EvaF (see edit history) 1 Link to comment Share on other sites More sharing options...
Hart Posted August 22, 2020 Share Posted August 22, 2020 seems not working in 1.7.6.7 Link to comment Share on other sites More sharing options...
EvaF Posted August 23, 2020 Share Posted August 23, 2020 ok then try <?php class AdminCustomersController extends AdminCustomersControllerCore { public function renderList() { $this->fields_list = array_merge($this->fields_list, array( 'groupname' => array( 'title' => $this->trans('Group', array(), 'Admin.Global'), 'maxlength' => 30 ) ) ); $this->_select .= ', ( SELECT GROUP_CONCAT(gl.name) FROM ' . _DB_PREFIX_ . 'customer_group g JOIN ' . _DB_PREFIX_ . 'group_lang gl on gl.id_group = g.id_group and gl.id_lang= '. (int) $this->context->language->id . ' WHERE g.id_customer = a.id_customer) as groupname '; return parent::renderList(); } } Link to comment Share on other sites More sharing options...
ventura Posted August 23, 2020 Share Posted August 23, 2020 19 hours ago, Hart said: seems not working in 1.7.6.7 Try it with this module 1 1 Link to comment Share on other sites More sharing options...
Carlo-o Posted October 1, 2020 Share Posted October 1, 2020 (edited) Hi, this works with all 1.7 versions? Regards! Edited October 1, 2020 by Carlo-o (see edit history) Link to comment Share on other sites More sharing options...
EvaF Posted November 17, 2020 Share Posted November 17, 2020 No the higher versions do not use AdminCustomerrController and therefore is neccessary to catch on hooks: actionCustomerGridDefinitionModifier ( and change definition of columns and filters (append group name) and actionCustomerGridQueryBuilderModifier (and change sqlParts (select and join)) by the same principle as above Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now