• Resolved beleza.jake

    (@belezajake)


    Hello,

    I would like to disable the lightbox/zoom and clickable hyperlink on the featured images for all products and their variations.

    Presently, when users hover the curser over featured images, a zoomable lightbox appears; and, the image displays a clickable hyperlink that opens the image in a new window. I would like to disable both these features.

    I have found and applied the following two lines of code, which work independently, but not concurrently. That is to say, I can disable either the lightbox/zoom feature OR the clickable hyperlink, but not both.

    The code to disable the lightbox and product zoom is:

    remove_theme_support( ‘wc-product-gallery-lightbox’ );

    remove_theme_support( ‘wc-product-gallery-zoom’ );

    The code to disable the image click is:

    function e12_remove_product_image_link( $html, $post_id ) {
    return preg_replace( “!<(a|/a).*?>!”, ”, $html );
    }
    add_filter( ‘woocommerce_single_product_image_thumbnail_html’, ‘e12_remove_product_image_link’, 10, 2 );

    Both lines of code have been applied to the Snippet plugin for custom CSS.

    Any advice would be appreciated.

    Thanks a million.

Viewing 1 replies (of 1 total)
  • Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    Since this is a few weeks old without help in customization, I am going to mark as resolved. A lot of people have found help in the Advanced WooCommerce group with things like this, so I would recommend checking there, or we highly recommend contacting one of the services on our Customizations page (https://woocommerce.com/customizations/)

Viewing 1 replies (of 1 total)
  • The topic ‘WooCommerce: Disable Lightbox and Hyperlink on Product Images’ is closed to new replies.