b.tsvetkov Posted June 10, 2016 Share Posted June 10, 2016 (edited) Hallo I'am using PrestaShop 1.6. Is it possible to search customers in customers page by their phone numbers. I tryed this way https://www.prestashop.com/forums/topic/325175-how-do-i-search-customer-by-their-phone-number-in-the-back-office/ , but it doesn't work. Please, help! Thank you! Edited June 12, 2016 by b.tsvetkov (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted June 11, 2016 Share Posted June 11, 2016 Here's a simple override that adds "Phone" and "Mobile" columns to the Customers > Addresses tab in the Back Office so you can filter by phone or mobile. Create override/controllers/admin/AdminAddressesController.php with the following: <?phpclass AdminAddressesController extends AdminAddressesControllerCore{ public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('Mobile'), 'filter_key' => 'a!phone_mobile'); [spam-filter] Remember to go to the Advanced Parameters > Performance tab and click the "Clear cache" button after creating the file. 3 Link to comment Share on other sites More sharing options...
b.tsvetkov Posted June 11, 2016 Author Share Posted June 11, 2016 Here's a simple override that adds "Phone" and "Mobile" columns to the Customers > Addresses tab in the Back Office so you can filter by phone or mobile. Create override/controllers/admin/AdminAddressesController.php with the following: <?phpclass AdminAddressesController extends AdminAddressesControllerCore{ public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('Mobile'), 'filter_key' => 'a!phone_mobile'); [spam-filter] Remember to go to the Advanced Parameters > Performance tab and click the "Clear cache" button after creating the file. Great, it's working! Thank you so much! 1 Link to comment Share on other sites More sharing options...
rocky Posted June 12, 2016 Share Posted June 12, 2016 Glad to help. Please edit your first post and add [sOLVED] to the title. Link to comment Share on other sites More sharing options...
b.tsvetkov Posted September 12, 2016 Author Share Posted September 12, 2016 It doesn't work on PrestaShop 1.6.1.7. After update the fields with phone number disappeared. Any solution for this problem? Thank You! Link to comment Share on other sites More sharing options...
b.tsvetkov Posted September 12, 2016 Author Share Posted September 12, 2016 It doesn't work on PrestaShop 1.6.1.7. After update the fields with phone number disappeared. Any solution for this problem? Thank You! Link to comment Share on other sites More sharing options...
rocky Posted September 13, 2016 Share Posted September 13, 2016 It's working fine on my PrestaShop v1.6.1.7 test site: Link to comment Share on other sites More sharing options...
MaakMijnWitgoed Posted May 1, 2017 Share Posted May 1, 2017 I'm new with using this override but I can't get it working in PrestaShop 1.6.1.12. Is there something changed in the past few versions? Link to comment Share on other sites More sharing options...
George Bazz Posted May 6, 2017 Share Posted May 6, 2017 Delete the /cache/class_index.php file. As it is stated in /override/readme_override.txt: Hello, Please read the documentation before trying to override something here. http://doc.prestashop.com/display/PS16/Overriding+default+behaviors Frequently Asked Questions Q: I added an override file but it seems to be ignored by PrestaShop A: You need to trigger the regeneration of the /cache/class_index.php file. This is done simply by deleting the file. It is the same when manually removing an override: in order to reinstate the default behavior, you must delete the /cache/class_index.php file. Worked, fine for me in 1.6.1.12 Link to comment Share on other sites More sharing options...
MaakMijnWitgoed Posted May 8, 2017 Share Posted May 8, 2017 Followed all steps mentioned in this thread but unfortunately no luck Link to comment Share on other sites More sharing options...
stweet Posted November 27, 2017 Share Posted November 27, 2017 any one know how to do this on 1.7 ? 1 Link to comment Share on other sites More sharing options...
hakeryk2 Posted December 1, 2017 Share Posted December 1, 2017 Does anyone has this code? Original one from post is with [spam filter] because it was too long probably. Link to comment Share on other sites More sharing options...
dandumit Posted January 17, 2018 Share Posted January 17, 2018 I guess that same trick can be added to search by tracking number... Daniel Link to comment Share on other sites More sharing options...
istox Posted March 19, 2018 Share Posted March 19, 2018 On 6/11/2016 at 2:53 PM, rocky said: Here's a simple override that adds "Phone" and "Mobile" columns to the Customers > Addresses tab in the Back Office so you can filter by phone or mobile. Create override/controllers/admin/AdminAddressesController.php with the following: <?phpclass AdminAddressesController extends AdminAddressesControllerCore{ public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('Mobile'), 'filter_key' => 'a!phone_mobile'); [spam-filter] Remember to go to the Advanced Parameters > Performance tab and click the "Clear cache" button after creating the file. Not working. [spam filter] locked the code Link to comment Share on other sites More sharing options...
zod Posted March 31, 2018 Share Posted March 31, 2018 The code missed just 2 curly brackets, the correct code is: <?php class AdminAddressesController extends AdminAddressesControllerCore{ public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('Mobile'), 'filter_key' => 'a!phone_mobile'); } } 1 1 Link to comment Share on other sites More sharing options...
Coloranti Posted June 27, 2018 Share Posted June 27, 2018 (edited) On 3/31/2018 at 12:13 PM, zod said: The code missed just 2 curly brackets, the correct code is: <?php class AdminAddressesController extends AdminAddressesControllerCore{ public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('Mobile'), 'filter_key' => 'a!phone_mobile'); } } This code works in PS 1.6.16! Thanks a lot @zod Edited June 27, 2018 by Coloranti (see edit history) Link to comment Share on other sites More sharing options...
MathiasReker Posted July 3, 2018 Share Posted July 3, 2018 you can search customers by phone from this module: https://addons.prestashop.com/en/order-management/39583-search-by-tracking-number-phone-etc.html Link to comment Share on other sites More sharing options...
Evi Posted February 19, 2019 Share Posted February 19, 2019 On 3/31/2018 at 12:13 PM, zod said: The code missed just 2 curly brackets, the correct code is: <?php class AdminAddressesController extends AdminAddressesControllerCore{ public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('Mobile'), 'filter_key' => 'a!phone_mobile'); } } It works for 1.7.2.2 as well. Thank you! 1 Link to comment Share on other sites More sharing options...
siomosp Posted June 7, 2019 Share Posted June 7, 2019 Works fine at 1.7.5.2 Added search for VAT and customer comments <?php class AdminAddressesController extends AdminAddressesControllerCore { public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('phonr'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('mobile'), 'filter_key' => 'a!phone_mobile'); $this->fields_list['other'] = array('title' => $this->l('comments'), 'filter_key' => 'a!other'); $this->fields_list['vat_number'] = array('title' => $this->l('VAT'), 'filter_key' => 'a!vat_number'); } } Link to comment Share on other sites More sharing options...
depurweb Posted October 31, 2019 Share Posted October 31, 2019 can i add this fuction on AdminCustomers? Link to comment Share on other sites More sharing options...
MANB Design Posted November 26, 2019 Share Posted November 26, 2019 in AdminOrdersController????? THX Link to comment Share on other sites More sharing options...
Prestag0od Posted April 23, 2020 Share Posted April 23, 2020 On 11/26/2019 at 1:33 PM, MANB Design said: in AdminOrdersController????? THX On 10/31/2019 at 6:48 PM, depurweb said: can i add this fuction on AdminCustomers? I also searching for solution about orders and customers pages... Did you find anything? Link to comment Share on other sites More sharing options...
DoGGoD Posted September 7, 2020 Share Posted September 7, 2020 On 6/11/2016 at 2:53 PM, rocky said: Here's a simple override that adds "Phone" and "Mobile" columns to the Customers > Addresses tab in the Back Office so you can filter by phone or mobile. Create override/controllers/admin/AdminAddressesController.php with the following: <?phpclass AdminAddressesController extends AdminAddressesControllerCore{ public function __construct() { parent::__construct(); $this->fields_list['phone'] = array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'); $this->fields_list['phone_mobile'] = array('title' => $this->l('Mobile'), 'filter_key' => 'a!phone_mobile'); [spam-filter] Remember to go to the Advanced Parameters > Performance tab and click the "Clear cache" button after creating the file. This works with Prestashop 1.7.6.7 as well. Awsome job! Link to comment Share on other sites More sharing options...
thehurricane Posted September 29, 2020 Share Posted September 29, 2020 is it possible to show phone number on customer list not on addresses list? 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