Hi , Is there a search string I can use to show all items in the database , say below £1 ?
I assume this could be added to the merchants search (merchants.php) so it shows all items from a certain retailer that are below £1??
search.php?q=merchant:Currys + search.php?q=price:0.00:2.00
so can these search strings be added together (i have tried )
thanks
Hi Jonny,
It wouldn't work in that format, but I will send you some code so that you can do that...
Cheers,
David.
Hi Jonny,
There isn't, but one can be easily added!
In search.php, look for the following code on line 73:
default:
...and insert the following new search string case immediately BEFORE that line:
case "price":
$sql = "SELECT * , MIN( price ) AS minPrice, MAX( price ) AS maxPrice, COUNT( id ) AS numMerchants FROM `".$config_databaseTablePrefix."products` WHERE price >= '".database_safe($parts[1])."' AND price <= '".database_safe($parts[2])."' GROUP BY name";
$sqlResultCount = "SELECT COUNT(DISTINCT(name)) as resultcount FROM `".$config_databaseTablePrefix."products` WHERE price >= '".database_safe($parts[1])."' AND price <= '".database_safe($parts[2])."'";
$orderBySelection = $orderByDefault;
$sort = "priceAsc";
break;
This will give you a new search string that supports the following format:
price:min:max
So, to get all products up to £1, use:
price:0.00:1.00
You can link directly to those results of course, something like this:
http://www.yoursite.com/search.php?q=price:0.00:1.00
Hope this helps!
Cheers,
David.