Jump to content
Sign in to follow this  
Anguz

advanced search tweaks

Recommended Posts

how do I add more fields to the search? I'd like to be able to search by product weight also

 

and would like to not make it a requisite to put a query for the search, I'd like for example to be able to get all the products in categ A and cost between 1 and 5, without using a keyword

 

how can I do this?

 

also, how do I make the "Search In Product Descriptions" checkbox checked by default?

Share this post


Link to post
Share on other sites

1. Look in the advance_search_result.php and half way down or so you will find a line that looks like this

 

default:

$where_str .= "(p.products_keywords like '%" . addslashes($search_keywords[$i]) . "%' or p.products_model like '%" . addslashes($search_keywords[$i]) . "%'";

$where_str .= ')';

 

I included a new field called products_keywords

 

the products_?????? will be different, but follow this format to include your new fields to the search.

 

 

2. To make the search in description on all the time - modify the line

 

in advanced_search.php

 

$info_box_contents[] = array('align' => 'right', 'text' => tep_draw_checkbox_field('search_in_description', '1', TRUE) . ' ' . TEXT_SEARCH_IN_DESCRIPTION);

 

this will always have the check box on the page marked true.

 

you also have to modify a piece of code since when the search is run from the search box, it will not include the description. I will look for that line and send it ASAP.

 

Steve


Have a Charming Day !!!

Lisa

Share this post


Link to post
Share on other sites
1. Look in the advance_search_result.php and half way down or so you will find a line that looks like this

 

default:

$where_str .= "(p.products_keywords like '%" . addslashes($search_keywords[$i]) . "%' or p.products_model like '%" . addslashes($search_keywords[$i]) . "%'";

$where_str .= ')';

 

I included a new field called products_keywords

 

the products_?????? will be different, but follow this format to include your new fields to the search.

 

hmm... ok, I found it and read the code around it and figured this is to decide what fields it'll look for the keywords in, right?

 

the new criteria I want to add to the search is "weight", but more than looking for the keyword there, I need to have a range, pretty much like the "date" and "price" options... I'm looking into the code for those two, but haven't figured it out yet...

 

about the keywords thing, I want to be able to run a search without keywords, and although the first time I tried it it didn't work, it seems to work now lol, I wonder what I did wrong before :P

 

the checkbox is checked now, thx for that too :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×