You are here:  » Merchant Logo

Support Forum



Merchant Logo

Submitted by cq on Wed, 2007-08-15 08:36 in

Hi,

I hv created /logos folder in directory and insert the following code at html/searchresults.php. How do i create a link from the logo to the product information page.

<?php
      
if (file_exists("logos/".$product["merchant"]))
      {
        print 
"<img src='".$config_baseHREF."logos/".$product["merchant"]."' />";
      }
      else
      {
        print 
"<img src='".$config_baseHREF."logos/default.png' />";
      }
?>

And also insert the above code to html/prices.php. How can I link the logo to that particular merchant listing of products page (not the list of merchants page).

thanks
jack

Submitted by support on Wed, 2007-08-15 08:46

Hi Jack,

The code for adding merchant logos to the prices table is in the following thread:

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

To make the logos displayed by your code above be a link to the merchant, try something like this:

<?php
      
if ($config_useRewrite)
      {
        
$href $config_baseHREF."merchant/".tapestry_hyphenate($product["merchant"])."/";
      }
      else
      {
        
$href $config_baseHREF."search.php?q=merchant:".urlencode($product["merchant"]);
      }
      print 
"<a href='".$href."'>";
      if (
file_exists("logos/".$product["merchant"]))
      {
        print 
"<img border='0' src='".$config_baseHREF."logos/".$product["merchant"]."' />";
      }
      else
      {
        print 
"<img border='0' src='".$config_baseHREF."logos/default.png' />";
      }
      print 
"</a>";
?>

That's the basic method. If you're not sure how to incorporate this into the places where you have the logo displayed, post the logo code that you are using i'll add the changes for you...

Cheers,
David.

Submitted by cq on Wed, 2007-08-15 08:54

thanks it works.

How about the html/searchresults.php.

<a href='<?php print $product["productHREF"]; ?>'><?php print translate("More Information"); ?>

How can i insert a logo instead of the above text.

Btw, how can i limit the column product display on feature products.

thanks.

Submitted by support on Wed, 2007-08-15 09:13

Hi,

Instead of the section you posted (from html/searchresults.php), try this...

<?php
print "<a href='".$product["productHREF"]."'>";
if (
file_exists("logos/".$product["merchant"]))
{
  print 
"<img border='0' src='".$config_baseHREF."logos/".$product["merchant"]."' />";
}
else
{
  print 
translate("More Information");
}
print 
"</a>";
?>

You could of course replace the "More Information" link with your default logo code instead if you wished...

Cheers,
David.

Submitted by cq on Wed, 2007-08-15 09:22

hi david,

thank you very much.

regards
jack