[FIX] Add ALT tag to sub-category images

For Articles relating to more than one ISC version
grantg
Posts: 112
Joined: Thu Oct 08, 2009 11:01 am

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

Post 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'
Cupar Garden Centre: CS-Cart Professional 2.2.5 (Converted from ISC 6.0.14 Ultimate)
Online Garden Centre: ISC 6.0.14 Professional
netjet
Posts: 74
Joined: Tue Nov 03, 2009 12:03 pm

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

Post 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?
Martin
Site Admin
Site Admin
Posts: 1854
Joined: Wed Jun 17, 2009 6:30 pm
Location: South Yorkshire UK
Contact:

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

Post 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.
netjet
Posts: 74
Joined: Tue Nov 03, 2009 12:03 pm

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

Post by netjet »

Ok Martin, Thanks. But why is it working for the new products for example?
grantg
Posts: 112
Joined: Thu Oct 08, 2009 11:01 am

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

Post by grantg »

I'm happy to say my head hurts :lol:
Cupar Garden Centre: CS-Cart Professional 2.2.5 (Converted from ISC 6.0.14 Ultimate)
Online Garden Centre: ISC 6.0.14 Professional
jason3w
Posts: 7
Joined: Wed May 19, 2010 11:49 pm

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

Post 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
Post Reply