Submitted by shogounou on Thu, 2009-05-14 08:00 in Price Tapestry
Hi David
Often, xml feeds have not the logo of the brand.
I would like to have a mod which allows to manually upload brand logo in a specific image folder in function of the brands in the feed.
Is it possible ?
I would use a folder called "brandlogos" instead of "logos", and then anywhere in the script that you have access to a $product["brand"] variable you can use this instead of $product["merchant"] to construct the image URL for use in the src attribute of your img tags.
With the above in place, you could also replace brand names with logos on the brand index page if you wanted to. In brands.php look for the following code on line 16:
Hi,
Brand logos could be implemented in exactly the same way as the merchant logos, as described in the following thread:
http://www.pricetapestry.com/node/314
I would use a folder called "brandlogos" instead of "logos", and then anywhere in the script that you have access to a
$product["brand"]
variable you can use this instead of $product["merchant"] to construct the image URL for use in the src attribute of your img tags.With the above in place, you could also replace brand names with logos on the brand index page if you wanted to. In brands.php look for the following code on line 16:
$item["name"] = $product["brand"];
...and REPLACE this with:
$brandLogo = "brandlogos/".$product["brand"];
if (file_exists($brandLogo))
{
$item["name"] = "<img border='0' src='".$brandLogo."' alt='".$product["brand"]."' />";
}
else
{
$item["name"] = $product["brand"];
}
Cheers,
David.