VirtueMart Forum

VirtueMart 2 + 3 + 4 => Security (https) / Performance / SEO, SEF, URLs => Topic started by: heslikk on February 09, 2017, 00:43:17 AM

Title: the ALT attribute in empty in Product detail page VM3
Post by: heslikk on February 09, 2017, 00:43:17 AM
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.
Title: Re: the ALT attribute in empty in Product detail page VM3
Post by: 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
Title: Re: the ALT attribute in empty in Product detail page VM3
Post by: heslikk on February 09, 2017, 15:56:59 PM
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
Title: Re: the ALT attribute in empty in Product detail page VM3
Post by: jenkinhill on February 09, 2017, 16:06:37 PM
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.