mtechama Posted October 13, 2005 Share Posted October 13, 2005 is there an easier way to find your products faster instead of going into the Porducts/Categories and wasting time to go through every categories to find that products or items I am using SKU#'s for the model numbers like SKU90128 in the model number? Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted October 13, 2005 Author Share Posted October 13, 2005 anyone opions? Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
shaytaan Posted October 14, 2005 Share Posted October 14, 2005 is there an easier way to find your products faster instead of going into the Porducts/Categories and wasting time to go through every categories to find that products or items I am using SKU#'s for the model numbers like SKU90128 in the model number? Yes.... you can search the product model number :lol: ?,???`???,?? God must love stupid people, he made so many ??,???`???,? Link to comment Share on other sites More sharing options...
mtechama Posted October 14, 2005 Author Share Posted October 14, 2005 Then How? Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted October 14, 2005 Author Share Posted October 14, 2005 ok I do have this product called "Magical Clam Shell Light" and the Products Number is "SKU34884" ok I try to use the search under Product/Catagories and I put this number "SKU34884" and nothing pulls up and when I put in "Magical Clam Shell Light" then I pulls that product from the database. since I sell over 3,000 products to edit my inventory to find my products faster I want to use the Model Number instead of my Products Name. Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
kgt Posted October 14, 2005 Share Posted October 14, 2005 If you want to completely give up on searching by product name, then change the following lines in admin/categories.php (around line 993 somewhere): from 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"); } else { $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 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"); } to 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_model like '%" . tep_db_input($search) . "%' order by pd.products_name"); } else { $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 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"); } Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
mtechama Posted October 14, 2005 Author Share Posted October 14, 2005 When I copy the new code and paste it I get errors Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /home/content/g/i/f/giftshop/html/catalog/admin/categories.php on line 795 Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
kgt Posted October 14, 2005 Share Posted October 14, 2005 When I copy the new code and paste it I get errors ....which are? You may have code that differs from mine. You will also need to post your code. Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
mtechama Posted October 14, 2005 Author Share Posted October 14, 2005 from 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"); } else { $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 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"); } to 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_model like '%" . tep_db_input($search) . "%' order by pd.products_name"); } else { $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 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"); } I have changed from 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 to this 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_model the one is underlined and in quotes Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
mtechama Posted October 14, 2005 Author Share Posted October 14, 2005 this is my code on mine if (isset($HTTP_GET_VARS['search'])) { $search = tep_db_prepare_input($HTTP_GET_VARS['search']); $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and cd.categories_name like '%" . tep_db_input($search) . "%' order by c.sort_order, cd.categories_name"); } else { $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id, c.sort_order, c.date_added, c.last_modified from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by c.sort_order, cd.categories_name"); } Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
kgt Posted October 14, 2005 Share Posted October 14, 2005 That's the categories query. Look more closely at the code. You need to find the same set of lines as those I posted. When you have a parse error, it usually requires seeing at THE VERY LEAST 10 lines before the quoted error line. Also, you need to note which line is the 'error line.' Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
mtechama Posted October 14, 2005 Author Share Posted October 14, 2005 Does this code works? I really don't know what I am looking for in the code I just don't see what you are talking about Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
kgt Posted October 14, 2005 Share Posted October 14, 2005 Does this code works? I really don't know what I am looking for in the code I just don't see what you are talking about Error codes almost always give you a line number where the error occurred. Parse errors occur when you have missing 'punctuation.' PHP, like all languages, has a certain syntax and grammar. When you're missing an 'end of sentence' mark (a semicolon ';'), the parser will throw an error for a line AFTER this missing punctuation. Consider the following phrase in English: I went to the store Because I have no period at the end of this phrase, you cannot be sure it's a complete sentence. PHP is the same way, except instead of a period, it uses a semicolon. The parser will throw an error when it comes across code that looks like a new 'sentence' without the end of sentence mark. The PHP parser knows when it comes across something it doesn't understand, but it cannot interpret what you meant. You need to find the line where the error occurred. Then you need to post that line, and several lines before AND after that. Contributions Discount Coupon Codes Donations Link to comment Share on other sites More sharing options...
mtechama Posted October 14, 2005 Author Share Posted October 14, 2005 Can you give me the full PHP code for that please Wade Morris Amarillo, Texas Before you do any changes on your site you need to do BACKUP! BACKUP! Link to comment Share on other sites More sharing options...
realistix Posted October 16, 2005 Share Posted October 16, 2005 Could you perhaps write me a code to change the search habit on my website. I would only like to search by model and nothing else. Do you think this will speed up results, especially now with some 7000 products. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.