Hey David,
How would I get the compare button to automatically click out to the cheapest merchant on the search result pages?
Thanks,
Zway
Hello Zway,
Sure - add the following code to the top of html/searchresults.php
<?php foreach($searchresults["products"] as $k => $product) { if ($product["numMerchants"]>1) { $sql = "SELECT id,buy_url FROM `".$config_databaseTablePrefix."products` WHERE name='".database_safe($product["name"])."' ORDER BY price"; database_querySelect($sql,$rows); $searchresults["products"][$k]["id"] = $rows[0]["id"]; $searchresults["products"][$k]["buy_url"] = $rows[0]["buy_url"]; } $searchresults["products"][$k]["productHREF"] = tapestry_buyURL($searchresults["products"][$k]); }?>
(note that this will affect Related Products also, but that can changed if required, just let me know...)
Cheers, David. -- PriceTapestry.com
©2006-2025 IAAI Software | Contact Us | Privacy Policy
Hello Zway,
Sure - add the following code to the top of html/searchresults.php
<?php
foreach($searchresults["products"] as $k => $product)
{
if ($product["numMerchants"]>1)
{
$sql = "SELECT id,buy_url FROM `".$config_databaseTablePrefix."products` WHERE name='".database_safe($product["name"])."' ORDER BY price";
database_querySelect($sql,$rows);
$searchresults["products"][$k]["id"] = $rows[0]["id"];
$searchresults["products"][$k]["buy_url"] = $rows[0]["buy_url"];
}
$searchresults["products"][$k]["productHREF"] = tapestry_buyURL($searchresults["products"][$k]);
}
?>
(note that this will affect Related Products also, but that can changed if required, just let me know...)
Cheers,
David.
--
PriceTapestry.com