Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Advanced Search - Additional Keyword Form Blanks & Handling

Advanced Search - Additional Keyword Form Blanks & Handling

Locked

Views: 1,729

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
15 Jun 2009, 7:54 PM
#1
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Advanced Search - Additional Keyword Form Blanks & Handling

I want to have additional blanks on the advanced search form.

I tried creating new fields, and setting each (additional) field name to ‘keyword'. This ends up creating a string (as part of the URL that is generated) with more than one &keyword= field.

BUT---
Only the LAST keyword is considered when the search is executed; anything preceding it is ignored.

Further, if the second blank is left blank, but the first has user entered data, it will return an error message (as I included the same value="" for the second blank if left as default.)

Obviously, this isn't working.

What about setting each blank field with a different name?

How can the search engine be modified so that it accepts the other fields as additional
search keywords that are searched as "AND" with each other blank field?

//&keyword=die+hard&categories_id=10&inc_subcat=1&manufacturers_id=4&pfrom=1&pto=5 0&dfrom=01%2F01%2F2003&dto=12%2F20%2F2005

What file decodes this and performs an SQL inquiry with the results?

How does the header_php.php file associated with the advanced search page work? What does it do?

17 Jun 2009, 2:28 AM
#2
donn avatar

donn

Zen Follower

Join Date:
Oct 2007
Posts:
241
Plugin Contributions:
0

Re: Advanced Search - Additional Keyword Form Blanks & Handling

Researching this further, I can't seem to find much information on this board about how the ZenCart search works.

Does anyone have a knowledge of which files are involved, and what function each performs?

I know that tpl_advanced_search_default.php draws the advanced search page, and creates a form, the contents of which are sent as part of the URL that is loaded after a user hits the search button.

But what role does the modules/pages/advanced_Search/header_php.php file play?

Can someone please help explain what each statement, contained in that file, such as:
$sData['keyword'] = (isset($_GET['keyword']) ? zen_output_string($_GET['keyword']) : zen_output_string(KEYWORD_FORMAT_STRING));
actually does?

I thought that this file builds the URL...but as long as a new field is named in the advanced search form, it always seems to end up as part of the advanced search results page URL that is generated, without any alteration to the header_php.php file.

Any help would be greatly appreciated.

As to more about WHY I'm asking all this....

I am well aware that users can AND / OR results using the existing keyword blank on the default advanced search form, but I still wish to have multiple blanks, each requesting a different type of user entered data.