Jump to content



Issue Information

  • #000472

  • 0 - None Assigned

  • New

  • 2.3.2

  • -

Issue Confirmations

  • Yes (0)No (0)
Photo

Products cannot be searched by Model in Admin Area. admin, search

Posted by panicgripdesigns on 30 July 2012 - 17:26

In the categories.php the $products_query for search only compares the search query to the product's title. In my company's experience this makes finding products difficult.


Line 860
	if (isset($HTTP_GET_VARS['search'])) {
	  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");

Replacement code:
	if (isset($HTTP_GET_VARS['search'])) {
	  $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and ( pd.products_name like '%" . tep_db_input($search) . "%' or p.products_model like '%" . tep_db_input($search) . "%') order by pd.products_name");

Not a bug.

Please make a post in the "tips and tricks" section of the Forum.

My mistake. Regardless, I feel this should be added to future versions, as it doesn't seem like it do any harm, and model numbers are searchable in the /catalog/ 's Quick Find feature.