disable the link to image source on product pages

Hi, could i please have some help with the disabling the link to the source of image on product pages?

so currently when a user clicks the main product image it takes them to the image source
where it states

http://i0.wp.com/www.domain.com/wp-content/uploads/2015/10/A2_Portfolio-1024x709.jpg?fit=1024%2C709

for example.and looks like this

Short Screencast video - http://take.ms/BJSu2

so instead when user clicks the image could it do nothing? (both in desktop and mobile views)

screenshot of change - http://take.ms/ptuqY

Domain - http://tinyurl.com/ounlhnf

Support Access is open

Thanks
Tom

  • Rupok

    Hi Tom

    Hope you had a wonderful day.

    so instead when user clicks the image could it do nothing? (both in desktop and mobile views)

    Yes. You can do this with jQuery by creating a MU Plugin. For creating a mu plugin, create a folder named "mu-plugins" inside your "wp-content" folder. Then inside that "mu-plugins" folder, create a file with any name and with a .php extension. Now paste the code inside that file and save.

    <?php
    add_action( 'wp_footer', 'show_checkout_button' );
    function show_checkout_button() {
        ?>
        <script type="text/javascript">
    		jQuery('.woocommerce-main-image').bind('click', false);
        </script>
        <?php
    }

    For getting more idea on mu plugins, you can go through this article: https://premium.wpmudev.org/manuals/wpmu-manual-2/using-mu-plugins/

    Have a nice day. Cheers!
    Rupok

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.