You are here:  » Merchant logo alt text


Merchant logo alt text

Submitted by Perce2 on Fri, 2021-08-13 08:01 in

Hi David,

further to recent email, I eventually managed to add missing "alt" text's to images throughout PT via the templates in PT configuration, but I'm stuck with adding them to the merchant Logo's. Looking to add the merchant name as alt text.

Could you advise how this can be done please?

Submitted by support on Fri, 2021-08-13 08:23

Hi,

Sure - edit pto_product.php and look for the following code at line 105:

        $merchant_html = "<img border='0' src='".$pto_config_externalBaseHREF."logos/".str_replace(" ","%20",$product->merchant).$pto_config_logoExtension."' />";

...and REPLACE with:

        $merchant_html = "<img alt='".htmlentities($product->original_name,ENT_QUOTES,get_option("blog_charset"))."' border='0' src='".$pto_config_externalBaseHREF."logos/".str_replace(" ","%20",$product->merchant).$pto_config_logoExtension."' />";

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Fri, 2021-08-13 10:26

Hi David,

Tried that, still not showing any "Alt" !

Submitted by Perce2 on Fri, 2021-08-13 10:35

Ah, just dawned on me!
This is for the logo's on the product pages, I am referring to the Logo's on the Merchants page... apologies for the confusion.

I missed this one anyway, thanks for that.

Cheers!

Submitted by support on Fri, 2021-08-13 11:31

Ah yes, that would be in pto_atoz.php although there's no product name in context, you could add the merchant name as alt text by looking for the following code at line 148:

        $item = "<img border='0' src='".$pto_config_externalBaseHREF."logos/".str_replace(" ","%20",$row->$module).$pto_config_logoExtension."' />";

...and REPLACE with:

        $item = "<img alt='".htmlentities($row->$module,ENT_QUOTES,get_option("blog_charset"))."' border='0' src='".$pto_config_externalBaseHREF."logos/".str_replace(" ","%20",$row->$module).$pto_config_logoExtension."' />";

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Fri, 2021-08-13 11:40

Product name was a typo, it was the merchant name that I actually wanted to show for these logo's.

Thanks David.

Submitted by Perce2 on Fri, 2021-08-13 11:55

Can we add Merchant name for Alt text please for this instance?

Submitted by support on Fri, 2021-08-13 13:19

Hi,

Above comment should add the merchant name as alt text if that's not working as expected let me know - apologies the thread became a bit mixed up because of the original post not being published...

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Fri, 2021-08-13 14:21

Oh right...

Your code for pto_atoz.php works fine thanks, but the code for the pto_poduct.php is showing the product title and not the merchant name.
Can you change this code to show alt merchant name please:

$merchant_html = "<img alt='".htmlentities($product->original_name,ENT_QUOTES,get_option("blog_charset"))."' border='0' src='".$pto_config_externalBaseHREF."logos/".str_replace(" ","%20",$product->merchant).$pto_config_logoExtension."' />";

Submitted by support on Fri, 2021-08-13 15:37

Sure - have a go with;

$merchant_html = "<img alt='".htmlentities($product->merchant,ENT_QUOTES,get_option("blog_charset"))."' border='0' src='".$pto_config_externalBaseHREF."logos/".str_replace(" ","%20",$product->merchant).$pto_config_logoExtension."' />";

Cheers,
David.
--
PriceTapestry.com

Submitted by Perce2 on Sat, 2021-08-14 04:29

Perfect!
Thanks David