Jump to content

[Minor] Category Dropdown in a Search Box


Recommended Posts

Guest EaglePilot

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

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:P

Link to comment
Share on other sites

×
×
  • Create New...