• Resolved browse.generico

    (@browsegenerico)


    Hi,
    I use your plugin “WooCommerce Dynamic Gallery LITE” with a theme that presents the products and passing over the mouse, it shows the second image of gallery.
    When I installed your plugin the second image of gallery is always the same of the “featured image”, so it shows the same immage, how can I fix it?
    I am attaching the theme code …
    I tried to change from [0] to [1] in the code, but it does not work
    thank you very much

    function woocommerce_template_loop_product_thumbnail() {
        global $product;
    
        echo '<a href="' . apply_filters( 'woocommerce_loop_thumbnail_url', get_permalink() ) . '">' . woocommerce_get_product_thumbnail();
    
        if ( ! yit_get_option( 'shop-use-second-image' ) ) return;
    
        // add another image for hover
        $attachments = $product->get_gallery_attachment_ids();
        if ( ! empty( $attachments ) && isset( $attachments[0] ) ) {
            yit_image( "id=$attachments[0]&size=shop_catalog&class=image-hover" );
        }
    
        echo  '</a>';
    }

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    https://ww.wp.xz.cn/plugins/woocommerce-dynamic-gallery/

The topic ‘second image on product mouse hover’ is closed to new replies.