Add search by phone number in Cs-cart

This is a minor modification to any of your existing addon.  If you don’t have an existing addon, do the changes in my_changes addon just make sure you have it installed.  To illustrate I will do the changes in my_changes addon.

  1. Make sure you have the addon installed.  Verify from Administration->addons page
  2. Enable hook in init.php, create file if not present.

    if (!defined('AREA')) { die('Access denied'); }
  3. Write the hook code in func.php, create file if not present.

    function fn_my_changes_get_users($params, $fields, $sortings, $condition, $join)
     if (isset($params['compact']) && $params['compact'] == 'Y') {
     $union_condition = ' OR ';
     } else {
     $union_condition = ' AND ';
     if (isset($params['phone']) && fn_string_not_empty($params['phone'])) {
     $condition .= db_quote(" $union_condition ? LIKE ?l", "%" . trim($params['phone']) . "%");
  4. Add template code, create folder and files if not present.

    <div class="search-field">
     <input class="input-text" type="text" name="phone" id="phone" value="{$}" />
  5. That’s it, just the clear cache admin.php?cc and check customers->customer expanded menu

In the similar way, you can add search by product name in order search, read this post.

Posted in CS-Cart, CS-Cart Addons

Leave a Reply

Your email address will not be published. Required fields are marked *