Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2009
    Posts
    78
    Plugin Contributions
    0

    Default Advanced Search: keyword not required

    I have this Advanced Search Page that I modified (with a little help from a friend).
    http://blackoliveeastnursery.net/zen...dvanced_search

    I would like to allow the user to search without having to enter a keyword. If I do not enter a keyword, and I use only one of the inputs below it, I get a message that says "At least one of the fields in the search form must be entered."

    As far as I can tell, the file that controls this is includes/modules/pages/advanced_search_result/header_php.php

    I think the code below may be what I need to alter.

    Something like this:

    Code:
    $error = false;
    
    $missing_one_input = false;
    
    
    
    $_GET['keyword'] = trim($_GET['keyword']);
    
    
    
    if ( (isset($_GET['keyword']) && (empty($_GET['keyword']) || $_GET['keyword']==HEADER_SEARCH_DEFAULT_TEXT || $_GET['keyword'] == KEYWORD_FORMAT_STRING ) ) &&
    
    (isset($_GET['dfrom']) && (empty($_GET['dfrom']) || ($_GET['dfrom'] == DOB_FORMAT_STRING))) &&
    
    (isset($_GET['dto']) && (empty($_GET['dto']) || ($_GET['dto'] == DOB_FORMAT_STRING))) &&
    
    (isset($_GET['pfrom']) && !is_numeric($_GET['pfrom'])) &&
    
    (isset($_GET['pto']) && !is_numeric($_GET['pto'])) ) {
    
     // $error = true;
    
      //$missing_one_input = true;
    
      //$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
    
    } else {
    
      $dfrom = '';
    
      $dto = '';
    
      $pfrom = '';
    
      $pto = '';
    
      $keywords = '';
    I tried commenting out the section below, but it doesn't seem to work. I still get the error message.

    Code:
    // $error = true;
    
      //$missing_one_input = true;
    
      //$messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);

    If anyone can help me with this, I would appreciate it.

    Bill

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

    Default Re: Advanced Search: keyword not required

    Were you able to fix this?

    I did a search without a keyword and it did pull up products ... if so, what was the secret to your success?
    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!]
    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!

 

 

Similar Threads

  1. Replies: 5
    Last Post: 20 Apr 2010, 12:54 PM
  2. Advanced Search - Additional Keyword Form Blanks & Handling
    By Donn in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Jun 2009, 03:28 AM
  3. Keyword As A Dropdown Box In Advanced Search
    By SteveCollins in forum General Questions
    Replies: 6
    Last Post: 26 Apr 2008, 02:34 AM

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