Hi
can possible to add search keyword in remove filter ..I already added brand,sub-category in remove filter.Now i want add search query keyword in to remove filter.
technoarenasol
Hi I add code for search keyword filter but its bot working.
<?php
function removeFilters($remove)
{
global $config_baseHREF;
global $q;
if(in_array("q",$remove))
{
$href = $config_baseHREF."search.php?q=bw:";
}
else
{
$href = $config_baseHREF."search.php?q=".urlencode($q);
}
$filters = array("minPrice","maxPrice","merchantFilter","categoryFilter","brandFilter","priceRange");
foreach($filters as $filter)
{
if ($GLOBALS[$filter] && !in_array($filter,$remove))
{
if (is_array($GLOBALS[$filter]))
{
foreach($GLOBALS[$filter] as $v)
{
$href .= "&".$filter."[]=".urlencode($v);
}
}
else
{
$href .= "&".$filter."=".urlencode($GLOBALS[$filter]);
}
}
}
return $href;
}
?>
Hi Amin,
Can you post the section of code you added that generates the link for the user to clear the keyword from the current search...
Thanks!
David.
--
PriceTapestry.com
Hi Amin,
In the removeFilters() function that you added from this thread, where you have this line:
$href = $config_baseHREF."search.php?q=".urlencode($q);
...REPLACE that with:
if(in_array("q",$remove))
{
$href = $config_baseHREF."search.php?q=bw:";
}
else
{
$href = $config_baseHREF."search.php?q=".urlencode($q);
}
You'll then be able to use the function for "q" in exactly the same way as your existing filters; in which case the search URL will be returned with q as "bw:" which is the search that returns all products (so other filters still apply of course)...
Cheers,
David.
--
PriceTapestry.com