Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search function in Catalog


desdemona

Recommended Posts

Posted

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

Posted

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.

Posted

Yes I tried and it works...but I still wanted to ask a pro to make sure.

 

Don't I have to add the field in a sql_query-line above? That's really it?

 

Thank you, Ethel

  • 3 weeks later...
Posted
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,

Archived

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

×
×
  • Create New...