Page 2 of 2

Re: [FIX] Add ALT tag to sub-category images

Posted: Sun Feb 14, 2010 4:37 pm
by grantg
Martin wrote:For 5.x Open: /lib/general.php

Find:

Code: Select all

$imageThumb .= '<img src="'.$thumb.'" alt="" />';
Replace with:

Code: Select all

$imageThumb .= '<img src="'.$thumb.'" alt="'.$GLOBALS['ProductName'].'" />';
In 5.5.2 (used Express Checkout in 5.0.6 so can't comment)

This works throughout the site except from standard checkout, an error is shown on the final page of checkout (before finalising the order and going to the PSP):

Undefined Index 'ProductName'

Re: [FIX] Add ALT tag to sub-category images

Posted: Tue Feb 16, 2010 6:55 pm
by netjet
grantg wrote:I have made the above changes in 5.0.6 and thought this may be of interest to others, if it wasn't already obvious

Open includes/display/SideProductRelated.php

Find alt=""

Replace with: alt="'.$GLOBALS['ProductName'].'"


Now the Related Products also have an alt tag. I do wonder why this has been missed in ISC, especially because the alt="" tag was already there! Nevermind...maybe it'll get fixed sooner rather than later.
Grantg,

Strange but it doesnt work for me, simple but it doesnt work...Is it working also if the database is already created, or only with new one?

Re: [FIX] Add ALT tag to sub-category images

Posted: Tue Feb 16, 2010 7:44 pm
by Martin
The reason it won't be working is because the $GLOBALS array won't contain the Product Name information for whatever reason... Most likely because it wasn't being pulled out or felt it was needed.

It should be a pretty simple fix but it's a question of locating the relevant code block and redefining that key=>value again.

Re: [FIX] Add ALT tag to sub-category images

Posted: Wed Feb 17, 2010 1:33 pm
by netjet
Ok Martin, Thanks. But why is it working for the new products for example?

Re: [FIX] Add ALT tag to sub-category images

Posted: Wed Feb 17, 2010 2:50 pm
by grantg
I'm happy to say my head hurts :lol:

Re: [FIX] Add ALT tag to sub-category images

Posted: Fri Jun 18, 2010 1:05 am
by jason3w
I have used the SQL query by GrantG described here
http://www.talkaboutselling.co.uk/site- ... 714p2.html

It worked a treat and now on product description pages the images have meaningful ALT tags.
The only thing not working is that on the category pages the thumbs do not have ALT tags.
Does anyone know how to get that working?
Thanks heaps
jason