Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Searching within order comments

    Hi,

    Using Zen 1.3.7.

    On the orders.php page, there is a search box for searching for specific orders/info. Works fine, except I would also like this to search for terms INSIDE the order comments section. So for example, if one of the orders had the words "express mail" inside the order comments section, I could run a search on the term "express mail" and, voila!, that order would appear on the search results list.

    I have looked in orders.php and found the search code:

    Code:
    // create search filter
      $search = '';
      if (isset($_GET['search']) && zen_not_null($_GET['search'])) {
        $keywords = zen_db_input(zen_db_prepare_input($_GET['search']));
        $search = " and (o.customers_city like '%" . $keywords . "%' or o.customers_postcode like '%" . $keywords . "%' or o.date_purchased like '%" . $keywords . "%' or o.billing_name like '%" . $keywords . "%' or o.billing_company like '%" . $keywords . "%' or o.billing_street_address like '%" . $keywords . "%' or o.delivery_city like '%" . $keywords . "%' or o.delivery_postcode like '%" . $keywords . "%' or o.delivery_name like '%" . $keywords . "%' or o.delivery_company like '%" . $keywords . "%' or o.delivery_street_address like '%" . $keywords . "%' or o.billing_city like '%" . $keywords . "%' or o.billing_postcode like '%" . $keywords . "%' or o.customers_email_address like '%" . $keywords . "%' or o.customers_name like '%" . $keywords . "%' or o.customers_company like '%" . $keywords . "%' or o.customers_street_address  like '%" . $keywords . "%' or o.customers_telephone like '%" . $keywords . "%' or o.ip_address  like '%" . $keywords . "%')";
    So I figured I would just try to add "or o.comments like '%" . $keywords . "%' " to this long list of search inputs, but that does not work. Pls don't laugh...I had to give it a try, right?!

    Can anyone tell me how to do this properly? It seems like it should be easy but I just do not know enough about the coding to do it.

    Thanks,

    Thomas

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Searching within order comments

    The comments are not in the orders table ... they are in the orders_status_history which is not part of the initial select statement in orders.php where the search is performed ...

    You would be better off making a separate search for that or you would need to add the orders_status_history table to the search ...

    This would not be a fun task, btw ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2007
    Location
    Eugene, OR
    Posts
    162
    Plugin Contributions
    0

    Default Re: Searching within order comments

    Quote Originally Posted by Ajeh View Post
    The comments are not in the orders table ... they are in the orders_status_history which is not part of the initial select statement in orders.php where the search is performed ...

    You would be better off making a separate search for that or you would need to add the orders_status_history table to the search ...

    This would not be a fun task, btw ...
    "This would not be a fun task" for Ajeh = "impossible to do" for Thomas

    So I guess I will forget about it for now. Thanks anyways.

 

 

Similar Threads

  1. v154 Searching order comments
    By perfumbg in forum Managing Customers and Orders
    Replies: 5
    Last Post: 27 May 2016, 09:46 PM
  2. Order Comments
    By Andy_GS in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Dec 2009, 04:16 PM
  3. Product duplicated within order
    By thomasharding in forum Managing Customers and Orders
    Replies: 3
    Last Post: 26 Oct 2009, 05:59 PM
  4. searching searching for this link
    By alwinch in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 12 Oct 2008, 06:41 PM
  5. My Order History and Order History Details - how do I get order comments in both?
    By trisha1581 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 29 Nov 2007, 06:37 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