Hide variant pictures Debut Theme

Solved
MotoxDJR
New Member
8 0 0

Look at picture below , i just want to show the main picture of the variant when selected and hide all the other thumbnails of the other variants as to not confuse the customers 

Thank You

Sans titre.png

0 Likes

This is an accepted solution.

The code block you are looking for starts on line 72 of the product-template.liquid file and ends on line 130.

You can delete this section of code, comment it out (as below) or maybe the simplest change is just to hide it with css.

Here's is the css option, added style="display:none;" to the root element on line 72:

<div data-thumbnail-slider style="display:none;">

 

Here's the whole block to be deleted entirely or commented out (using <!-- at the beginning and --> at the end):

        <div data-thumbnail-slider >
          <div class="thumbnails-wrapper{% if enable_thumbnail_slides == true %} slider-active{% endif %}" data-slider>
            {% if enable_thumbnail_slides == true %}
              <button type="button" class="btn btn--link medium-up--hide thumbnails-slider__btn thumbnails-slider__prev thumbnails-slider__prev--{{ section.id }}" data-slider-button>
                {% include 'icon-chevron-left' %}
                <span class="icon__fallback-text">{{ 'sections.slideshow.previous_slide' | t }}</span>
              </button>
            {% endif %}

            <ul class="product-single__thumbnails product-single__thumbnails-{{ section.id }}" data-slider-container>
              {% if enable_thumbnail_slides == true %}
                <div class="product-single__thumbnails-slider-track" data-slider-track>
              {% endif %}

              {% for media in product.media %}
                <li class="product-single__thumbnails-item product-single__thumbnails-item--{{ section.settings.media_size }} {% if enable_thumbnail_slides == true %} product-single__thumbnails-item-slide{% endif %} js"{% if enable_thumbnail_slides == true %} data-slider-slide-index="{{ forloop.index0 }}" data-slider-item{% endif %}>
                  <a href="{{ media.preview_image | img_url: product_image_zoom_size, scale: product_image_scale }}"
                    class="text-link product-single__thumbnail product-single__thumbnail--{{ section.id }}"
                    data-thumbnail-id="{{ section.id }}-{{ media.id }}"
                    {% if enable_thumbnail_slides == true %} data-slider-item-link{% endif %}
                    {% if enable_image_zoom %}data-zoom="{{ media.preview_image | img_url: product_image_zoom_size, scale: product_image_scale }}"{% endif %}>

                      {%- capture thumbnailAlt -%}
                        {%- if media.media_type == 'video' or media.media_type == 'external_video' -%}
                          {{ 'sections.featured_product.video_thumbnail_alt' | t: imageAlt: media.alt | escape }}
                        {%- elsif media.media_type == 'model' -%}
                          {{ 'sections.featured_product.model_thumbnail_alt' | t: imageAlt: media.alt | escape }}
                        {%- else -%}
                          {{ 'sections.featured_product.gallery_thumbnail_alt' | t: imageAlt: media.alt | escape }}
                        {%- endif -%}
                      {%- endcapture -%}

                      <img class="product-single__thumbnail-image" src="{{ media.preview_image | img_url: '110x110', scale: 2 }}" alt="{{ thumbnailAlt }}">
                      {%- if media.media_type == 'video' or media.media_type =='external_video' -%}
                        <div class="product-single__thumbnail-badge">
                          {% include 'icon-video-badge-full-color' %}
                        </div>
                      {%- endif -%}
                      {%- if media.media_type == 'model' -%}
                        <div class="product-single__thumbnail-badge">
                          {% include 'icon-3d-badge-full-color' %}
                        </div>
                      {%- endif -%}
                  </a>
                </li>
              {% endfor %}

              {% if enable_thumbnail_slides == true %}
                </div>
              {% endif %}
            </ul>
            {% if enable_thumbnail_slides == true %}
              <button type="button" class="btn btn--link medium-up--hide thumbnails-slider__btn thumbnails-slider__next thumbnails-slider__next--{{ section.id }}" data-slider-button data-slider-button-next>
                {% include 'icon-chevron-right' %}
                <span class="icon__fallback-text">{{ 'sections.slideshow.next_slide' | t }}</span>
              </button>
            {% endif %}
          </div>
        </div> 

 

 

 

 

If my response was helpful please Like and Mark As Solution.
0 Likes

Do this to fix it in 20 seconds:

1. In your Shopify Admin go to: online store > themes > actions > edit code
2. Find Asset > theme.scss.liquid or theme.css and paste this at the bottom of the file:

.thumbnails-wrapper{
    display: none !important;
}



Additionally, you may want to take a look at this blog post that teaches you how to add a swiping feature for your product page image, making it more user-friendly and, subsequently, generating more sales.

It also has the feature you're looking for (hiding thumbnails) at the customize page, which you can easily turn on/off at any time.

diego_ezfy_0-1612134177996.png

 



Kind regards,
Diego

◦ Problem Solved? ✔️ Please click on Accept as Solution and like.
◦ Using a free theme? Improve it with copy/paste code snippets clicking here.
◦ Looking to hire an experienced developer? Same day response: ezfycode@gmail.com.
0 Likes
MotoxDJR
New Member
8 0 0

Thank you guys !

0 Likes