Hi David,
i can add other case: in search.php (not sitesearch) i try add others case but with this change search not search.
case "tutte le offerte" || "Tutte le Offerte" || "TUTTE LE OFFERTE":
$where = "search_name LIKE '%'";
$sql = "SELECT SQL_CALC_FOUND_ROWS id,COUNT(id) AS numMerchants,MIN(price) as minPrice FROM `".$config_databaseTablePrefix."products` WHERE ".$where.$priceWhere." GROUP BY search_name";
$orderBySelection = $orderByDefault;
break;
I add this in search.php next the line 238 but not work.
Thanks,
Marco Saiu
Hi David,
is an example i have more additional bypass for example:
case "tutti gli sconti" || "Tutti gli Sconti" || "TUTTI GLI SCONTI":
$where = "search_name LIKE '%' AND rebate <> ''";
$sql = "SELECT SQL_CALC_FOUND_ROWS id,COUNT(id) AS numMerchants,MIN(price) as minPrice FROM `".$config_databaseTablePrefix."products` WHERE ".$where.$priceWhere." GROUP BY search_name";
$orderBySelection = $orderByDefault;
if $q equal to this make this query and not default query.
Thanks,
Marco Saiu
Hi Marco,
Sure - you can insert the new case just before the default case, so where you have the following code at line 239:
default:
...REPLACE with:
case "tutti gli sconti":
case "Tutti gli Sconti":
case "TUTTI GLI SCONTI":
$where = "search_name LIKE '%' AND rebate <> ''";
$sql = "SELECT SQL_CALC_FOUND_ROWS id,COUNT(id) AS numMerchants,MIN(price) as minPrice FROM `".$config_databaseTablePrefix."products` WHERE ".$where.$priceWhere." GROUP BY search_name";
$orderBySelection = $orderByDefault;
default:
Or rather than the repeated case statements, to catch all cases you could strtolower() $parts[0] in the switch() statement so where you have the following code at line 99:
switch($parts[0])
...and REPLACE with:
switch(strtolower($parts[0]))
And then instead of the above replacement, just:
case "tutti gli sconti":
$where = "search_name LIKE '%' AND rebate <> ''";
$sql = "SELECT SQL_CALC_FOUND_ROWS id,COUNT(id) AS numMerchants,MIN(price) as minPrice FROM `".$config_databaseTablePrefix."products` WHERE ".$where.$priceWhere." GROUP BY search_name";
$orderBySelection = $orderByDefault;
default:
Cheers,
David.
--
PriceTapestry.com
Hi Marco,
You can link to all products using the bw: (begins with) operator - with nothing after the ":" it returns all products; for example...
<a href='<?php print $config_baseHREF; ?>search.php?q=bw:'>Tutte le Offerte</a>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com