skip to Main Content

am using oscommerce v2.3.1
in this advanced_search. php ,advanced_search_result.php i think they Search by default Product_name

but i have to add one more field(Categories ) in this

here they are filtering the keyword

$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 tried but not succeed please help me how to add that one



  1. Try adding:

    $where_str .= "p2c.categories_id = '" . (int)$categories_id . "' and ";


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

    where $categories_id is the specific id of the category to be searched. Searching all sub cats is a different story.

    Login or Signup to reply.
  2. The following contribution allows searching of the entire site. It adds the following features:

    • Search in product descriptions
    • Search in product attributes
    • Search in language files
    • Search in articles (if Article Manager addon installed)
    • Search in pages (if Page Editor addon installed)
    • If a search is performed on a word and no product matches are found, a form
      appears allowing the customer to email the shop owner asking for information
      about the product.
    • A modified version of the Advanced Search Box is included. The price boxes and
      category selector can be enabled/disabled via settings in the
      includes/boxes/search.php file.

    download template from here:

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top