Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Search problem in Admin


Dj-Viper

Recommended Posts

Posted

Hi,

 

I have a search problem in the admin. When i am in the categories/products etc, i want to search on the Product Model number but when i do that i get no results, if i search on product titel it works fine.

 

Do i search in the shop itself on a product number than it works.

 

How do i get it to work in the Admin.

 

Greetings, Anne

Posted

Hi,

 

I have a search problem in the admin. When i am in the categories/products etc, i want to search on the Product Model number but when i do that i get no results, if i search on product titel it works fine.

 

Do i search in the shop itself on a product number than it works.

 

How do i get it to work in the Admin.

 

Greetings, Anne

You just need to add that field to the sql statement in the categories.php about 3/4 of the way down.

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

Posted

Hi,

 

Any info on what the code is. and where exactly to enter.

 

Greetings, Anne

Keep in mind that I have a very customized shop and this code will likely not be even close to your existing code. But you can see in my code where is searches against the products_id, vendors_products_id (which is a custom field), products_model & products_name. Just add the fields you want to search against as I did. If you just use my code as is you will definitely get an error.

 

This is all about line 1100 in my code.

 

 

   $products_count = 0;
   if (isset($HTTP_GET_VARS['search'])) {
       $products_query = tep_db_query("select p.products_id, p.products_model, 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, p.vendors_products_id, 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_id = '" . tep_db_input($search) . "'  or p.vendors_products_id like '" . tep_db_input($search) . "%'  or  pd.products_name like '%" . tep_db_input($search) . "%'  or p.products_model like '" . tep_db_input($search) . "%') order by pd.products_name");
   } else {
     $products_query = tep_db_query("select p.products_model, 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 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 p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
   }
   while ($products = tep_db_fetch_array($products_query)) {
     $products_count++;
     $rows++;

Community Bootstrap Edition, Edge

 

Avoid the most asked question. See How to Secure My Site and How do I...?

  • 3 weeks later...
Posted

Hi,

 

Indeed heavy altered script.. I have tried a few things, also adding only the Products id search to the string, but nothing worked..

 

Greetings, Dj Viper

Archived

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

×
×
  • Create New...