Results 1 to 9 of 9
  1. #1
    Join Date
    May 2009
    Posts
    155
    Plugin Contributions
    0

    Default Customer Search in Admin?

    Using the search button under Customers in admin is it possible to search by full name or even better customer id number?

    We have a lot of customer names in this section and if you need to find someone with a common surname e.g. Brown the search may give out 100+ matching entries and then you manually need to check through them all to find the right one, whereas if you could search by full name e.g. Mary Brown it would bring up far fewer results, or by the database unique customer ID number then it would bring up only the one matching record.

    Thought I would check in case there is a way to do this that I just don't know about as it seems strange to only search for part of a name.

    Any ideas or tips on how to do this?

  2. #2
    Join Date
    Oct 2015
    Location
    BC, Canada
    Posts
    41
    Plugin Contributions
    0

    Default Re: Customer Search in Admin?

    *bump*
    I need to be able to search customers by ID. Anyone?

    TIA.

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: Customer Search in Admin?

    What about search by phone number, which is already available.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Oct 2015
    Location
    BC, Canada
    Posts
    41
    Plugin Contributions
    0

    Default Re: Customer Search in Admin?

    Thanks, swguy, but for me it must be by ID....

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: Customer Search in Admin?

    OK. What version of Zen Cart do you have?
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Oct 2015
    Location
    BC, Canada
    Posts
    41
    Plugin Contributions
    0

    Default Re: Customer Search in Admin?

    1.5.1
    Thanks!

  7. #7
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: Customer Search in Admin?

    Change line admin/customers.php line 1045-1049 from:

    Code:
        if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
          $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
          $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%' or c.customers_telephone rlike ':keywords:' or a.entry_company rlike ':keywords:' or a.entry_street_address rlike ':keywords:' or a.entry_city rlike ':keywords:' or a.entry_postcode rlike ':keywords:'";
          $search = $db->bindVars($search, ':keywords:', $keywords, 'regexp');
        }
    to

    Code:
        if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
          $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
          // CID search
          if ((strlen($keywords) < 6) && is_numeric($keywords)) {
             $cid = (int)$keywords;
             $search = "where c.customers_id = " . $cid;
          } else {
             // end CID search
             $search = "where c.customers_lastname like '%" . $keywords . "%' or c.customers_firstname like '%" . $keywords . "%' or c.customers_email_address like '%" . $keywords . "%' or c.customers_telephone rlike ':keywords:' or a.entry_company rlike ':keywords:' or a.entry_street_address rlike ':keywords:' or a.entry_city rlike ':keywords:' or a.entry_postcode rlike ':keywords:'";
             $search = $db->bindVars($search, ':keywords:', $keywords, 'regexp');
          }
        }
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  8. #8
    Join Date
    Oct 2015
    Location
    BC, Canada
    Posts
    41
    Plugin Contributions
    0

    Default Re: Customer Search in Admin?

    It worked! Thank you SO MUCH! Do you have a donate link I can use? Would love to support your work. :)

  9. #9
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,681
    Plugin Contributions
    123

    Default Re: Customer Search in Admin?

    LOL that's very kind of you. Please make a contribution to the Zen Cart project.

    https://www.zen-cart.com/content.php?6-donate
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 25 Jan 2011, 02:05 PM
  2. Customize admin customer search query: search alt emails, too?
    By Matt008 in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 15 Apr 2010, 01:10 AM
  3. Replies: 3
    Last Post: 27 Aug 2007, 08:29 PM
  4. Admin Search Differs From Product Search
    By DiZZ in forum General Questions
    Replies: 6
    Last Post: 15 Jan 2007, 04:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR