PDA

View Full Version : Missing Logo's in feed workaround


Andy
05-05-07, 16:30
Hi

We've all been mightily p**sed off about the lack of merchant logo's in our api's.

This issue is holding the launch of our API back, we can't sell if we have a crap looking feed.

So, in desperation I have created this workaround. It is not a fix, and introduces another slight problem, but it's better than a page full of the default nologo image. I'd be interested to know what AffWin think of this fix and the inherent "leeching" it creates.

In includes/elements/product_display_list.php find: $oProduct->sMerchantLogoUrl = $aMerchants[$oProd->iMerchantId]->sLogoUrl;
Directly below it add:
############### merchant logo Workaround ###########
if($oProduct->sMerchantLogoUrl ==""){
$oProduct->sMerchantLogoUrl = 'http://www.affiliatewindow.com/logos/'.$oProd->iMerchantId.'/logo.gif';
}
############## END merchant logo workaround #########


In includes/elements/featured_merchants.php find:
$oNewMerchant= new stdClass();
$oNewMerchant->iId= $oMerchant->iId;
$oNewMerchant->sName= $oMerchant->sName;
$oNewMerchant->sLogoUrl= $oMerchant->sLogoUrl;
Directly below it add:
############### merchant logo Workaround ###########
if($oNewMerchant->sLogoUrl == ""){
$oNewMerchant->sLogoUrl = 'http://www.affiliatewindow.com/logos/'.$oMerchant->iId.'/logo.gif';
}
############## END merchant logo workaround #########
In includes/elements/product_display.php find:
################################################
# SMARTY ASSIGN
Directly ABOVE that add:
############### merchant logo Workaround ###########
if($oMerchant->sLogoUrl ==""){
$oMerchant->sLogoUrl = 'http://www.affiliatewindow.com/logos/'.$oProduct->iMerchantId.'/logo.gif';
}
############## END merchant logo workaround #########

Save and upload.

i think Ive got all instances of logos in there, if not, ill post again

It's pretty obvious what is going on with the code.

if the merchant logo isnt in the feed, therefore equals NULL (=="") then the merchant logo URL should be the logo image that you see in your AffWin account next to the merchant descriptions.

As you can see, you will now be Leeching the image from AffWin instead of where it was supposed to be coming from.
Leeching isn't a good practice, but at the end of the day, this is the best I think we can all do.

I'm sure a few of you out there will find this workaround useful

Andy
23-10-07, 20:37
Looks like the logos are missing again!

slight improvement on the above code.

all instances of:
if($oMerchant->sLogoUrl ==""){
change to:
if(strlen($oMerchant->sLogoUrl) < 46){

this checks the length of $oMerchant->sLogoUrl.
bear in mind the string should be in this form:
http://www.affiliatewindow.com/logos/MID/logo.gif

so if the logo is empty, or the MID is missing, it'll revert to dragging it from affiliate window.

Bud
23-10-07, 21:23
Andy

That is real neat - Thank You!

I owe you one!

Bud
30-10-07, 12:13
Andy

That's proving to be a great help (especially as they went again this morning).

I've been having a tinker to see if I could get my default NoLogo to come up when the merchant doesn't even have a logo on awin. I seem to have got close but can't get it right.

Is that possible? Any ideas?

Cheers
Bud