Hello David,
I have this button on my productpage under the description.
foreach($product["products"] as $p)
{
if ($p["price"] == $product_main["price"])
{
$html = "<a class='button tiny radius success' href='".tapestry_buyURL($p)."'>Meer informatie over dit product!</a>";
if ($p["voucher_code"])
{
$html .= " (".translate("using voucher code")." <span class='pt_pr_vouchercode'>".$p["voucher_code"]."</span>)";
}
$product_bestPriceMerchants[] = $html;
}
}
When there are more then two merchant offering this product i get two buttons.
What do i need to change?
Thanks Jan Roel
Hello Jan,
If you only want to display the code generated within the loop for the first (cheapest) merchant you can add a break; - have a go with;
foreach($product["products"] as $p)
{
if ($p["price"] == $product_main["price"])
{
$html = "<a class='button tiny radius success' href='".tapestry_buyURL($p)."'>Meer informatie over dit product!</a>";
if ($p["voucher_code"])
{
$html .= " (".translate("using voucher code")." <span class='pt_pr_vouchercode'>".$p["voucher_code"]."</span>)";
}
$product_bestPriceMerchants[] = $html;
}
break;
}
Cheers,
David.
--
PriceTapestry.com