Author Topic: the ALT attribute in empty in Product detail page VM3  (Read 784 times)

heslikk

  • Beginner
  • *
  • Posts: 5
  • A beginner
the ALT attribute in empty in Product detail page VM3
« 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
Code: [Select]
foreach ( $products as $product ) { add
Code: [Select]
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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 25812
  • Always on vacation
    • Jenkin Hill Internet
Re: the ALT attribute in empty in Product detail page VM3
« Reply #1 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
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

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

Currently using VM3.2.3 on Joomla 3.7.2 PHP 7.0.19

Testing VM3.2.3 on J!3.7.2

heslikk

  • Beginner
  • *
  • Posts: 5
  • A beginner
Re: the ALT attribute in empty in Product detail page VM3
« Reply #2 on: February 09, 2017, 15:56:59 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

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 25812
  • Always on vacation
    • Jenkin Hill Internet
Re: the ALT attribute in empty in Product detail page VM3
« Reply #3 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.
Kelvyn

Jenkin Hill Internet,
Keswick, Lake District

Unsolicited PMs/emails will be ignored.

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

Currently using VM3.2.3 on Joomla 3.7.2 PHP 7.0.19

Testing VM3.2.3 on J!3.7.2