Zen Cart Logo
Forums / General Questions / Advanced Search: keyword not required

Advanced Search: keyword not required

Locked

Views: 744

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
12 Oct 2009, 7:55 PM
#1
lndlyb4 avatar

lndlyb4

New Zenner

Join Date:
Mar 2009
Posts:
78
Plugin Contributions:
0

Advanced Search: keyword not required

I have this Advanced Search Page that I modified (with a little help from a friend).
http://blackoliveeastnursery.net/zenCart_boe2/index.php?main_page=advanced_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:

$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.

// $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

12 Oct 2009, 10:49 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

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? :smile: