Remove the product image link - by MAHDAR

This topic has 3 replies, 3 voices, and was last updated 5 months, 1 weeks ago ago by Andrew Mitchell

  • Avatar: mahdar
    MAHDAR
    Participant
    July 15, 2024 at 17:10

    Hello, I hope you are well

    When we click on the product image, nothing opens and that’s right

    Because I want the picture not to be enlarged on the computer when someone clicks on it. Is this correct?

    But this rule does not work in the phone

    please check it

    Thank

    Please, contact administrator
    for this information.
    2 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    July 16, 2024 at 09:25

    Hi @MAHDAR,

    Please try adding the following code under functions.php file locates in your child theme:

    
    add_action('wp_footer', 'n2t_wp_footer');
    function n2t_wp_footer(){
    	if(is_singular('product')){
    		?>
    		<script>
                jQuery( function($){
                    $(document).ready(function(){
                        $('.woocommerce-product-gallery__image a').attr('data-large', '');
                        $('.woocommerce-product-gallery__image a').attr('href', '#');
                    })
                });
    		</script>
    		<?php
    	}
    }
    

    Hope it helps!

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff
    July 16, 2024 at 11:21

    Dear MAHDAR,

    In the spirit of gratitude, we want to express our appreciation for your trust in our products. As a valued customer, your experience matters greatly. Would you consider sharing it by giving our theme a deserving 5-star rating on ThemeForest?

    Click here to share your thoughts: https://themeforest.net/downloads

    Being part of our community means a lot, and your feedback contributes immensely.

    Best Regards,
    The 8Theme Team

  • Viewing 3 results - 1 through 3 (of 3 total)

The issue related to '‘Remove the product image link’' has been successfully resolved, and the topic is now closed for further responses

Helpful Topics

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.