Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    21
    Plugin Contributions
    0

    Default User-friendly Search results page

    I would like to modify the search results page when it says 'There is no product that matches the search criteria.' and include the Advanced Search fields. In other words, when search result is empty Advanced Search is offered on the same page.
    I suppose I should edit \includes\modules\product_listing.php file but I am not familiar with PHP.
    Please advise how to achieve this so the Search Engine will be more user-friendly.
    Thanks.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: User-friendly Search results page

    /includes/modules/pages/advanced_search_result/header_php.php
    near the bottom of the file, you have a section of code like the following.
    Add the highlighted lines to get the effect you mentioned:
    Code:
    $breadcrumb->add(NAVBAR_TITLE_1, zen_href_link(FILENAME_ADVANCED_SEARCH));
    $breadcrumb->add(NAVBAR_TITLE_2);
    
    $result = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_LISTING, 'p.products_id', 'page');
    if ($result->number_of_rows == 0) {
      $messageStack->add_session('search', TEXT_NO_PRODUCTS, 'caution');
      zen_redirect(zen_href_link(FILENAME_ADVANCED_SEARCH, zen_get_all_get_params('action')));
    }
    
    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_ADVANCED_SEARCH_RESULTS', $keywords);
    .
    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    May 2007
    Posts
    21
    Plugin Contributions
    0

    Default Re: User-friendly Search results page

    Perfect! Thanks Dr.Byte!

 

 

Similar Threads

  1. Replies: 3
    Last Post: 2 Apr 2012, 01:24 PM
  2. Not a Zen user yet - couple questions: How user friendly? UPS & Paypal etc
    By eseesnad in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 11 Aug 2009, 08:31 PM
  3. Replies: 8
    Last Post: 5 Dec 2006, 10:52 PM

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