You can loop over $product["products"] to access the image_url value for each merchant. The following example code will load an array ($images) with all available image_url values for all merchants on the page except for the cheapest merchant, who's image will be displayed as the main image on the page:
<?php $images = array(); foreach($product["products"] as $p) { if ($p["image_url"]) $images[] = $p["image_url"]; } if (count($images)) { print "<ul>"; foreach($images as $k => $image) { if (!$k) continue; print "<li><img src='".$image."' /></li>"; } print "</ul>"; } ?>
The first (cheapest) merchant is excluded with this line:
Hi,
You can loop over $product["products"] to access the image_url value for each merchant. The following example code will load an array ($images) with all available image_url values for all merchants on the page except for the cheapest merchant, who's image will be displayed as the main image on the page:
<?php
$images = array();
foreach($product["products"] as $p)
{
if ($p["image_url"]) $images[] = $p["image_url"];
}
if (count($images))
{
print "<ul>";
foreach($images as $k => $image)
{
if (!$k) continue;
print "<li><img src='".$image."' /></li>";
}
print "</ul>";
}
?>
The first (cheapest) merchant is excluded with this line:
if (!$k) continue;
Hope this helps!
Cheers,
David.
--
PriceTapestry.com