You are here:  » Merchant Image for best price

Support Forum



Merchant Image for best price

Submitted by kiddaclo on Tue, 2010-01-19 15:08 in

Sorry for all the questions I have searched the forum for this and can't find anything but I'm sure it's come up before.

If I want a merchant image instead of text for the 'Best Price' merchant how would I go about it?

I want to do something similar to what I did in prices.php with this code:

<?php
      
if (file_exists("logos/".$product["merchant"]))
      {
        print 
"<a target='_BLANK' href='".tapestry_buyURL($product)."'><img border='0' src='".$config_baseHREF."logos/".$product["merchant"]."' alt='".$product["name"]."' /></a>";
      }
      else
      {
        print 
"&nbsp;";
      }
      
?>

I really must sit down and learn php!!

Cheers,
Chris.

Submitted by support on Tue, 2010-01-19 15:16

Hi Chris,

The code to display the merchant name (and associated affiliate link) is
as follows from line 28 of includes/product.php

<a href='<?php print tapestry_buyURL($priceProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$priceProduct["merchant"]); ?>><strong><?php print $priceProduct["merchant"]; ?></strong></a><br />

So to replace that with images in a similar way to prices.php; REPLACE
the above with:

<?php if (file_exists("logos/".$mainProduct["merchant"])):?>
<a href='<?php print tapestry_buyURL($priceProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$priceProduct["merchant"]); ?>><img border='0' src='<?php print $config_baseHREF."logos/".$mainProduct["merchant"]; ?>' /></a><br />
<?php else: ?>
<a href='<?php print tapestry_buyURL($priceProduct); ?>' <?php print javascript_statusBar(translate("go to")." ".$priceProduct["merchant"]); ?>><strong><?php print $priceProduct["merchant"]; ?></strong></a><br />
<?php endif; ?>

Hope this helps!

Cheers,
David.

Submitted by kiddaclo on Tue, 2010-01-19 15:51

Great David, Thankyou.

Cheers,
Chris.