Hi David,
what do i have to do, if i like to search for a specific Brand and a specific Category?
If i enter the following in the search box it dosnt work.
brand:%brandname%:category:%categoryname%:
Thanks for your help!
Best,
Martin
Hi David,
this dosnt work :(
{
case "merchant":
// pass through to category
case "category":
// pass through to brand
case "brand":
$where = " ".$parts[0]."='".database_safe($parts[1])."' ";
if ($parts[2])
{
$where .= " AND ".database_safe($parts[2])."='".database_safe($parts[3])."' ";
}
Hi Martin,
My apologies, I was on the road earlier and didn't check the code far enough ahead for compatibility. There is existing code to look for a 3rd part and search the product name for that. This is done by the following code, which is probably now immediately after where you have included the above modification:
if (isset($parts[2])) if ($parts[2]) $where .= "AND search_name LIKE '%".database_safe(tapestry_search($parts[2]))."%'";
...which would of course stop it from working. If you don't need to be able to search for a category and part of the name; just comment out or delete the above line, and it should then work as described above...
Cheers,
David.
Hi Martin,
That style of query can be supported quite easily. In search.php you will find the following code starting on line 36:
case "merchant":
// pass through to category
case "category":
// pass through to brand
case "brand":
$where = " ".$parts[0]."='".database_safe($parts[1])."' ";
To allow another section to be added; add this code on the next line:
if ($parts[2])
{
$where .= " AND ".database_safe($parts[2])."='".database_safe($parts[3])."' ";
}
...and the query as described in your post should then work!
Cheers,
David.