How can i disable image zooming and remove the zoom icon from product page image in dawn theme?

Hello thank you in advance.

I have dawn theme and when I go to product page there is a zoom button how can I disable zooming and hide the zoom icon.

Also there is no button in theme editor that says disable zooming so I need some code snippet thank you guys.

1 Like

@Souhiiii ,

  1. In your Shopify Admin go to online store > themes > actions > edit code
  2. In your theme.liquid file, find the (press CTRL + F or command + F on Mac)
  3. paste this code right above the tag:

Kind regards,
Diego

6 Likes

Works perfectly. Thanks a lot @diego_ezfy !

@diego_ezfy

Would it be possible to do this (turn zoom off and remove zoom icon) just for mobile? That’s where it’s more of an issue.

Thanks for the info!

Hello,

Thank you for your solution. But is there a way to prevent product zoom, but not prevent play button of videos uploaded onto product page as “media” ?

When I use the solution listed here, product zoom is stopped yes. And on desktop actually I can still see and use play button on videos. But on mobile, there is no play button. It seems the coding causes the play button to be hid on video as well.

Thanks

Hi @stevrons , @Souhiiii , @Smeelah

I propose a different solution than Diego_ezfy, which is, in my opinion, cleaner and also doesn’t disable anything you wouldn’t want.

Here are the steps:

  • In your Shopify Admin, go to O****nline Store > Themes > Actions > Edit Code
  • Open the product-thumbnail.liquid file under Snippets
  • Go to line 76 where it says

    {%- liquid
      case media.media_type
      when 'video' or 'external_video'
        render 'icon-play'
      when 'model'
        render 'icon-3d-model'
      else
        render 'icon-zoom'
      endcase
    -%}
  
  • Change that to
{% comment %}
    
      {%- liquid
        case media.media_type
        when 'video' or 'external_video'
          render 'icon-play'
        when 'model'
          render 'icon-3d-model'
        else
          render 'icon-zoom'
        endcase
      -%}
    
  {% endcomment %}
  
  {%- if media.media_type == 'video' or media.media_type == 'external_video' -%}
    
      {%- liquid
          render 'icon-play'
      -%}
    
  {%- endif -%}
  
  {%- if media.media_type == 'model' -%}
    
      {%- liquid
          render 'icon-3d-model'
      -%}
    
  {%- endif -%}
  • This code block does the same as before for video and 3D models, but not for normal product images. The comment at the beginning is the original code, if you would want to revert the function back to its original way.

  • Go to line 111 where it says


  • Change that to
{% comment %}
    
  {% endcomment %}
  
  {%- if media.media_type == 'video' or media.media_type == 'external_video' -%}
    
  {%- endif -%}
  
  {%- if media.media_type == 'model' -%}
    
  {%- endif -%}
  • This code block does the same as before for video and 3D models, but not for normal product images. The comment at the beginning is the original code, if you would want to revert the function back to its original way.

I hope my solution is satisfactory.

@diego_ezfy I have custom coding which removed the zoom feature on my products, would you know how I can add this back on?

i’ve been looking for a solution for so long and this was perfect, thank you so much