Zen Cart Logo
Forums / Basic Configuration / Product Search in Admin

Product Search in Admin

Views: 6,686

Results 21 to 22 of 22
2 Feb 2011, 8:47 PM
#21
igofresh avatar

igofresh

Zen Follower

Join Date:
Oct 2010
Posts:
149
Plugin Contributions:
0

Product Search in Admin

Fix worked for me too!! Thanks fortune81

History does not repeat itself but it does rhyme - Mark Twain

17 Oct 2011, 5:00 PM
#22
worede avatar

worede

New Zenner

Join Date:
Oct 2011
Posts:
1
Plugin Contributions:
0

Re: Product Search in Admin

great thanks, i now fix the same problem of my worede-fashion site. and just fix the upper half code , before the "else" , below is full code after i swap it:

// fix duplicates and force search to use master_categories_id

  $products_query_raw = ("select p.products_type, 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,
                                   p.products_model,
                                   p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
                                   p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
                                   p.products_quantity_order_max, p.products_sort_order
                            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)$_SESSION['languages_id'] . "'
                            and p.products_id = p2c.products_id
                            and (
                            pd.products_name like '%" . zen_db_input($_GET['search']) . "%'
                            or pd.products_description like '%" . zen_db_input($_GET['search']) . "%'
                            or p.products_model like '%" . zen_db_input($_GET['search']) . "%')" .
                            $order_by);

/* $products_query_raw = ("select p.products_type, 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,
p.products_model,
p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
p.products_quantity_order_max, p.products_sort_order,
p.master_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)$_SESSION['languages_id'] . "'
and (p.products_id = p2c.products_id
and p.master_categories_id = p2c.categories_id)
and (
pd.products_name like '%" . zen_db_input($_GET['search']) . "%'
or pd.products_description like '%" . zen_db_input($_GET['search']) . "%'
or p.products_id = '" . zen_db_input($_GET['search']) . "'
or p.products_model like '%" . zen_db_input($_GET['search']) . "%')" .
$order_by);
*/

} else {
  $products_query_raw = ("select p.products_type, 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, p.products_model,
                                   p.products_quantity_order_min, p.products_quantity_order_units, p.products_priced_by_attribute,
                                   p.product_is_free, p.product_is_call, p.products_quantity_mixed, p.product_is_always_free_shipping,
                                   p.products_quantity_order_max, p.products_sort_order
                            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)$_SESSION['languages_id'] . "'
                            and p.products_id = p2c.products_id
                            and p2c.categories_id = '" . (int)$current_category_id . "'" .
                            $order_by);
}

// Split Page