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