OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Adding new fields to search
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > General Support
digicammad
I'm trying to amend the search to include a couple of new fields from the product_description table, but can't work out how to do this. Any chance somebody could lend a hand?

Thanks

Ian
fxtrader777
I am interested in it too

also removing existing fields or modifying
Mav666
Your search string is composed in advanced_search_result.php, you could change the line

$where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";

to something more suitable. As long as it is text searches you are after you can basically replace the fields that are there with the ones you want to look in or add on to the list.
digicammad
QUOTE
Your search string is composed in advanced_search_result.php, you could change the line

$where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";


Thanks. Where would I change the query to make the new fields available?
digicammad
Okay, found it. For anybody else wanting to do this you change the search string as described by Mav666 above, then you look for the following string and make the same change there.

CODE
    $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, pd.products_description, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price ";


So if you are running the header tags contribution and want to include the keywords in the search, the field you need to add is pd.products_head_keywords_tag.

Ian
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.