You are here:  » printing logos instead of names on merchant page

Support Forum



printing logos instead of names on merchant page

Submitted by Paddy on Tue, 2009-11-10 15:49 in

Hi David,
Is there a guide to printing logos instead of names on the merchant page?
Thanks,
Patrick

Submitted by support on Tue, 2009-11-10 15:59

Hi Patrick,

Have a look at the information in this thread regarding showing merchant logos within the price comparison table. The directory and method of storing merchant logos would be the same; and then to use those logos in place of the merchant name on the merchant index page; have a look for the following code on line 14 of merchants.php

      $item["name"] = $feed["merchant"];

...and REPLACE that with:

      if (file_exists("logos/".$feed["merchant"]))
      {
        $item["name"] = "<img src='".$config_baseHREF."logos/".$feed["merchant"]."' border='0' />";
      }
      else
      {
        $item["name"] = $feed["merchant"];
      }

Hope this helps!

Cheers,
David.

Submitted by Paddy on Tue, 2009-11-10 16:10

Hi David,
Just implemented and got this error

"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/sites/tabletopdishwasher.org.uk/public_html/merchants.php on line 16"

according to dreamweaver line 16 is

$item["name"] "";
thanks
Patrick

Submitted by support on Tue, 2009-11-10 16:12

Hi Patrick,

ooops - there was an = missing - i've corrected in the post above...

Cheers,
David.

Submitted by support on Tue, 2009-11-10 16:15

Just another comment to add; if using the new distribution you would need to use $product["merchant"] in place of $feed["merchant"], otherwise exactly the same.

Cheers,
David.

Submitted by Convergence on Mon, 2012-11-12 17:12

v12/10B

Hi David,

Tried the above using $product["merchant"] and still unable to display the merchant logo instead of their text name.

Have the following (BEFORE this mod) in merchants.php (excluding the "$banner" & "require" items at the bottom):

<?php
  require("includes/common.php");
  $atoz["items"] = array();
  $sql = "SELECT DISTINCT(merchant) FROM `".$config_databaseTablePrefix."products` ORDER BY merchant";
  if (database_querySelect($sql,$rows))
  {
    foreach($rows as $product)
    {
      $item = array();
      $item["name"] = $product["merchant"];
      if (file_exists($config_logoDirectory."logos/".$product["merchant"]))
       {
         $item["logo"] = $config_logoBaseHREF."logos/".$product["merchant"];
       }
      if ($config_useRewrite)
      {
        $item["href"] = urlencode(tapestry_hyphenate($product["merchant"]))."/";
      }
      else
      {
        $item["href"] = "search.php?q=merchant:".urlencode($product["merchant"]).":";
      }
      $atoz["items"][] = $item;
    }
  }

Suggestions?

Thanks!

Submitted by support on Mon, 2012-11-12 18:12

Hi,

This section of your mod:

      if (file_exists($config_logoDirectory."logos/".$product["merchant"]))
       {
         $item["logo"] = $config_logoBaseHREF."logos/".$product["merchant"];
       }

...would rely on $config_logoDirectory and $config_logoBaseHREF being set - they're not distribution variables so that would be reliant on them being present, otherwise you could have a go with:

      if (file_exists("logos/".$product["merchant"]))
       {
         $item["logo"] = $config_baseHREF."logos/".$product["merchant"];
       }

Cheers,
David.
--
PriceTapestry.com

Submitted by Convergence on Mon, 2012-11-12 19:53

Hi David,

I think this mod is interfering:

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

Submitted by support on Tue, 2012-11-13 09:18

Hi,

Ah, your custom $config_logoDirectory and $config_logoBaseHREF variables already contain the logos/ part, so have a go with just:

      if (file_exists($config_logoDirectory.$product["merchant"]))
       {
         $item["logo"] = $config_logoBaseHREF.$product["merchant"];
       }

Cheers!

David.
--
PriceTapestry.com

Submitted by moparr360 on Tue, 2012-12-18 15:23

Hello David

I purchased the Dark Thoughts Template, have uploaded very easily. Now the Merchant logos do not show up on the product page - just the name of the merchant can you help me with this.

Also is there an option to use an image for the "Visit Store"

Thank You
Bobby

Submitted by support on Tue, 2012-12-18 15:43

Hi Bobby,

PriceTapestryTemplates.com are a separate company (although it also run by a Dave!) but he provides great support for his templates you should be able to contact him from this page...

Cheers,
David.
--
PriceTapestry.com