Post by MonaAbdelkader » Mon Jul 10, 2017 5:20 pm

Hi,
Please I want to change alt tag value for product images to be the image file name not the product name .. how can I do that?

Thanks in advance,


Posts

Joined
Mon Jul 10, 2017 5:16 pm

Post by paulfeakins » Mon Jul 10, 2017 6:32 pm

Find the alt tags in the product template:
/catalog/view/theme/default/template/product/product.tpl

Image

Then change them to be what is currently in the src attribute.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by CartIdeas » Mon Jul 10, 2017 7:06 pm

Using the value of src in alt will show the full path of image. If you need only filename use basename function. It will be something like

Code: Select all

src = "<?php echo basename($image); ?>"

User avatar
New member

Posts

Joined
Sun Dec 04, 2016 1:32 pm
Who is online

Users browsing this forum: No registered users and 29 guests