You are here:  » Displaying merchant logos above prices

Support Forum



Displaying merchant logos above prices

Submitted by Harvey on Wed, 2008-10-29 20:13 in

Hi David

The current code in prices.php...

<div class='prices'>
<table width='100%' cellpadding='4'>
    <?php foreach($prices["products"] as $product): ?>
    <tr bgcolor='#ffffcc'>
      <td width="200"><a href='<?php print $product["merchantHREF"]; ?>'><?php print $product["merchant"]; ?></a></td>
      <td><?php print $product["name"]; ?></td>
      <td><strong><?php print $config_currencyHTML.$product["price"]; ?></strong></td>
      <td align='center'><a href='<?php print tapestry_buyURL($product); ?>'><?php print tranlate("Visit Store"); ?></a></td>
    </tr>
    <?php endforeach; ?>
  </table>

Any idea how I get it so that the merchant logo appears above the price - so it, kind of, loops rightwards instead of down?

I.e.

Logo Logo Logo
Price Price Price

Cheers :)

Submitted by support on Thu, 2008-10-30 09:50

Hi Harvey,

Do you already have merchant logos on your site in a /logo/ directory as described in this thread:

http://www.pricetapestry.com/node/314

If so, you can do this within the price cell of the above code, in other words changing the following line:

      <td><strong><?php print $config_currencyHTML.$product["price"]; ?></strong></td>

as follows:

      <td align='center'>
      <?php
      if (file_exists("logos/".$product["merchant"]))
      {
        print "<img src='".$config_baseHREF."logos/".$product["merchant"]."' />";
      }
      ?>
      <strong><?php print $config_currencyHTML.$product["price"]; ?></strong>
      </td>

Cheers,
David.