News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

the ALT attribute in empty in Product detail page VM3

Started by heslikk, February 09, 2017, 00:43:17 AM

Previous topic - Next topic

heslikk

Hi,
In the category page, the thumbnail images have an ALT attribute in source view. However, the ALT attribute in empty in Product detail page.

Could you please suggest what change is required, so that ALT attribute has values in Product detail page. This will help in SEO. Version J2.5+VM3.

what I do - in file components/com_virtuemart/sublayouts/products.php after foreach ( $products as $product ) { add if (!empty($product->images[0])) {
if ( empty( $product->images[0]->file_meta ) ) {
  $product->images[0]->file_meta = htmlspecialchars($product->product_name);
}
}
but this not working..

Sorry for bad English.
Thanks.

jenkinhill

Quote
Version J2.5+VM3.

See http://forum.virtuemart.net/index.php?topic=128401.0

In latest VM versions with default templates the image alt is populated on the product details page. For example see  http://demo.virtuemart.net/cowboy-hat-detail
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

heslikk

Quote from: jenkinhill on February 09, 2017, 12:46:43 PM
Quote
Version J2.5+VM3.

See http://forum.virtuemart.net/index.php?topic=128401.0

In latest VM versions with default templates the image alt is populated on the product details page. For example see  http://demo.virtuemart.net/cowboy-hat-detail
i use VirtueMart 3.0.14

jenkinhill

Then updating may fix your problem, but test on a copy of your site, as you don't say if you are using template overrides or default VM templates.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum