Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

Searching Option Values


  • You cannot reply to this topic
1 reply to this topic

#1 iiinetworks

  • Community Member
  • 3,734 posts
  • Real Name:Matt

Posted 26 October 2003, 08:57

To add products where the keywords match the option value name to the search results: Around line 213 of advanced_search_result.php, change
   $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";
to
   $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_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_OPTIONS
_VALUES . " pov on pa.options_values_id=pov.products_options_values_id, " . TABL
E_PRODUCTS_TO_CATEGORIES . " p2c";
Around line 223, change
   $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.pr
oducts_id and p2c.categories_id = c.categories_id ";
to
   $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.pr
oducts_id and p2c.categories_id = c.categories_id and pa.products_id=p.products_
id ";
Around lines 258, change
           $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) .
 "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufactur
ers_name like '%" . tep_db_input($keyword) . "%'";
to
           $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) .
 "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufactur
ers_name like '%" . tep_db_input($keyword) . "%' or pov.products_options_values_
name like '%" . tep_db_input($keyword) . "%'";
Hth,
Matt

#2 einshoej

  • Community Member
  • 1 posts
  • Real Name:Henrik Jakobsen

Posted 01 November 2011, 16:10

I have implemented the below mod, and it works very well - however it makes the search very slow - both advanced searches and quick searches from the search box. Can anyone help me get the option box "search in description" included in the code to make it possible to exclude the large search by unticking the option box.

An other or even better oppotunity would be to add an extra option box to make "search in option fields" optional as well - in that way both you could still make a fast search in the descriptions without the option fiels.

I hope someone can help me out here and I hope this request is posted in the correct way.