mariano_quilmes Posted October 30, 2009 Posted October 30, 2009 Hello I'm trying to understand how advance_search.php and advance_search_results.php works in order to make a quick find box that can actually search in other tables apart from the title one. I dont know if it there is any contribution like these, or outsource plugin that do this, but I dont know if my first mistake was to use a separate table for my extra fields and those fields are arranged as a chain. If someone has come accross with a problem similar to this please help me because as i coul discovered, advance search uses the $keyword to compare with the query made by $listing_sql = $select_str . $from_str . $where_str . $order_str; $select_str = "select distinct " . $select_column_list . " m.manufacturers_id, p.products_id, pd.products_name, 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 "; $from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id "; I cannot understand where I can put my query that would be something like this I think Select products_id, products_extra_fields_id, products_extra_fields_vale from product_to_products_extra_fields I think what I have to do is to add the table query in $select_str, $from_str and then in $where_str but I don't know how to do it. $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) . "%'"; 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) . "%'"; Here I leave a Snapshot of what I want to do. Im really lost. Thanks in advance for any help. Mariano.
Jack_mcs Posted October 31, 2009 Posted October 31, 2009 See SiteSearch Plus in My Addons. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
Recommended Posts
Archived
This topic is now archived and is closed to further replies.