Alt attribute missing - by Nico313 - on WordPress WooCommerce support

11 replies3 participantsUpdated by Rose Tyler

  • Avatar: Nico313
    Nico313
    Participant

    Hi,

    Is missing Alt attribute in /legenda/woocommerce/content-product.php line 78. (or see picture)

    This issue is detected by Bing Webmaster SEO Suggestions.

    Thank you for your help.

    Best regards.

    Please, contact administrator
    for this information.

    11 Answers

    Avatar: Rose Tyler
    Rose Tyler
    Support staff

    Hello,

    Please clear cache and check now. We’ve made changes in legenda/woocommerce/content-product.php.

    Regards

    Avatar: Nico313
    Nico313
    Participant

    Hi,

    Not Work. What change ?
    "if ( $hoverImg == '' ) $hoverImg = '<img src=' . $hoverUrl . ' alt />';" ?

    Regards.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff

    Hello,

    I’m not sure if understand your request. Please scan the site now using the plugin. If if you will be not satisfied with result, please explain the problem with more details for better understanding.

    Regards

    Avatar: Nico313
    Nico313
    Participant

    Hi, Sure.

    On hover, the image Change :
    – First image do not show alt informations.
    – Second image (.hide-image) shows alt informations.

    For SEO, we nned to have a maximum of image with alt attribute filled

    You can see an exemple on the following link.

    Regards.

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Participant

    Hello,

    Unfortunately, the function that used to show the hover image does not include the alt for the image. Will be ok for you if hover image has the same alt as the main image?

    Regards

    Avatar: Nico313
    Nico313
    Participant

    Hi Olga,

    Thank you for your answer.

    No, it can’t be the same. I prefer ther is none alt attribute.

    It is a bad news. It is really complicate to change the function ? May you work on it for an other update ? It will be great for SEO.

    Best regards.

    Avatar: Olga Barlow
    Olga Barlow
    Participant

    We can replace existing featured image by the first image from the product gallery. Then you’ll get 2 different alts. As I can see that you actually use the gallery image for the featured image, so this will be a good solution for you. What do you think?

    Regards

    Avatar: Nico313
    Nico313
    Participant

    Ok, let’s try. It will be good.

    Thank you.

    Could you tell me if you change other things that legenda/woocommerce/content-product.php line 75

    if ( $hoverUrl != '' ) {

    Best regards.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff

    Hello,

    We’ve made changes in child-theme/woocommerce/content-product.php Please check now.

    Regards

    Avatar: Nico313
    Nico313
    Participant

    Hi,

    Since last version of Legenda there two issue on /woocommerce/content-product.php :

    1- line 83 : miss ” ” for alt $hoverAlt.
    Solution : alt=" '.$hoverAlt.' ">';

    2 – Alt for swaped image dont work : it display the same ALT of the first image.
    Solution :
    Replace ` elseif ( $product->get_image() ) {
    $img_id = get_post_thumbnail_id($post->ID);
    $hoverAlt = get_post_meta($img_id , ‘_wp_attachment_image_alt’, true);
    }`
    By` elseif ( $product->get_gallery_image_ids() ) {
    $attachment_ids = $product->get_gallery_image_ids();
    $hoverAlt = get_post_meta($attachment_ids[0] , ‘_wp_attachment_image_alt’, true);
    }`

    i’m not sure it is correct but it work.

    Regards

    Avatar: Rose Tyler
    Rose Tyler
    Support staff

    Hello,

    Thanks for contacting us.
    I’ve sent this information to our developers. They will check and add fixes in the next update of the theme.

    Regards

Want to reply? Log in, or register with your ThemeForest purchase code, to reply to this topic.

Login / Register