Dear David,
i try to group results in search page per ean (if possible).
I apply group per ean in product.php with apply this code:
https://www.pricetapestry.com/node/3217
But in search.php not work!
I use latest PT version.
Thanks,
Marco Saiu
Hello Marco,
The equivalent REPLACEment for additional grouping by `ean` (product page only) to the modification described in node 3217 would be;
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE normalised_name = '".database_safe($q)."' ORDER BY price";
$numRows = database_querySelect($sql,$rows);
$ean = "";
foreach($rows as $row)
{
if ($row["ean"])
{
$ean = $row["ean"];
break;
}
}
if ($ean)
{
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE normalised_name = '".database_safe($q)."' OR ean='".database_safe($ean)."' ORDER BY price";
$numRows = database_querySelect($sql,$rows);
}
However, this would still leave search results ungrouped. What would be a much better approach as you have ean available would be Automatic Product Mapping by Unique ID ...
Cheers,
David.
--
PriceTapestry.com