goober999 Posted December 7, 2005 Share Posted December 7, 2005 File Name :: Category Dropdown in a Search Box Author :: goober999 Category :: Minor CubeCart Version :: Description This mod adds a category dropdown box to the search that limits the search to the selected category. View File Link to comment Share on other sites More sharing options...
Guest vrakas Posted December 8, 2005 Share Posted December 8, 2005 Very nice :( Link to comment Share on other sites More sharing options...
Guest Posted December 8, 2005 Share Posted December 8, 2005 indeed Link to comment Share on other sites More sharing options...
Guest EaglePilot Posted December 8, 2005 Share Posted December 8, 2005 After I installed it, when I search All Categories, everything works as normal. When I try and search a category, I get this: MySQL Error Occured 1064: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '4 LIMIT 0, 15' at line 1 QUERY = SELECT * FROM CubeCart_inventory WHERE (name LIKE '%filter%' OR description LIKE '%filter%' OR productCode LIKE '%filter%') 4 I also noticed in the instructions, the @@@START@@@ and @@@END@@@ file is different for this part: @@@ START @@@ Edit includes/content/viewCat.inc.php +++------------------- find this line of code +++------------------- if(isset($_GET['searchStr'])){ +++------------------- insert this line of code after it +++------------------- $search_cat_id = $_GET['search_cat_id'] != "" ? " AND cat_id = ".$db->mySQLsafe($_GET['search_cat_id']) : ""; +++------------------- find this block of code +++------------------- $productListQuery = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE ".$like; +++------------------- REPLACE it with this line of code +++------------------- $productListQuery = "SELECT * FROM ".$glob['dbprefix']."CubeCart_inventory WHERE ".$like.$search_cat_id; +++------------------- @@@ END @@@ Edit includes/boxes/searchForm.inc.php If anyone can help with my error, I would appreciate it. Thanks, Greg Link to comment Share on other sites More sharing options...
Guest Posted December 9, 2005 Share Posted December 9, 2005 What you should do is modify it so that its just a check box under the search bar or something. so you just tickit & it has the Search this category only text beside it. plus CC2 compatibility :P Link to comment Share on other sites More sharing options...
Guest EaglePilot Posted December 10, 2005 Share Posted December 10, 2005 Anyone? Link to comment Share on other sites More sharing options...
Recommended Posts