Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search function in Catalog


desdemona

Recommended Posts

Hello,

If I add a field into the table 'products' how can I make my search engine search this table contents too?

 

I just altered this in advanced_search_results.php, is this alright?

 

$keyword = tep_db_prepare_input($search_keywords[$i]);

$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) . "%'";

$where_str .= " or p.newfield like '%" . tep_db_input($keyword) . "%'";

 

if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";

$where_str .= ')';

break;

 

Thanks for help, Ethel

Link to comment
Share on other sites

Looks pretty close. Have you tried it?

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

  • 3 weeks later...
sorry, again...

don't I have to define the keywords or the new fields anywhere else? or in any other file?

 

hi,

 

well in my opinion, u dont have to enter the new fields in anywhere else. u have entered the field(s) at the rite place. i have done the same for a new field of products table of my client's database. it works perfectly.

 

cheers,

 

Irfan

Irfan,

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...