Preview Choose Options Messed Up

Topic summary

A user implemented code changes to add navigation arrows to product image carousels on their Shopify store’s landing page. While the arrows now work correctly, this modification broke the ‘Choose options’ preview functionality on the homepage.

Changes Made:

  • Set Desktop layout to ‘Thumbnail Carousel’ in theme customization
  • Added slider enablement code to product-media-gallery.liquid
  • Inserted custom CSS for arrow styling and positioning

Technical Details:

  • Code includes conditional logic for thumbnail slider layout
  • CSS controls arrow dimensions (35-40px), positioning, border radius, and background color
  • Includes responsive adjustments for mobile viewports

Current Status:
The issue remains unresolved. The user provided a preview link and detailed code snippets but hasn’t received responses yet on how to fix the broken ‘Choose options’ preview while maintaining the arrow functionality.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

HELLO GUYS, I did the following changes to add arrows to the product images in the landing page. That fixed the issue, but the problem is that the ‘Choose options’ preview part in the home page is messed up. please advise. Thanks. PAGE https://qyuwxvreqcayf1g2-78669414739.shopifypreview.com

WHAT I DID
First of all, make sure that the ‘Desktop layout’ in the product information section on the product page is ‘Thumbnail Carousel’ (see on the screenshot below; this is in the customization mode of your theme: Admin account menu - Online Store - Themes - Customize) :

Next, go back to Admin account menu - Online Store - Themes - Edit Code.

So, the first code:

{% if section.settings.gallery_layout == 'thumbnail_slider' %} enable_desktop_slider slider--tablet-up {% endif %}

Copy

You need to add it to a specific place in the product-media-gallery.liquid file to enable arrows for slider. Here are the screenshots of where I have this code:

Now you need to add a CSS code for your arrows.

Take a look at the screenshots below to see exactly where you need to add it (still in the product-media-gallery.liquid file):

Here’s my code for the arrows on both desktop and mobile:

    {% comment %} style start {% endcomment %}
    <style>
      .product--thumbnail .product__media-item:not(.is-active),
      .product--thumbnail_slider .product__media-item:not(.is-active) {
        display: block !important;
      }
      .arrow_desktop_slider--prev, .arrow_desktop_slider--next {
        position: absolute;
        transform: translateY(-50%);
        top: 50%;
        border: 1px solid #fff;
        background: #fff !important;
        width: 40px;
        height: 40px;
        border-radius: 50%;
      }
      .arrow_desktop_slider--prev{
        left:1.1rem;
      }
      .arrow_desktop_slider--next{
        right:1.1rem;
      }
      .enable_desktop_slider li{
        width:calc(100% - 0rem)!important;
      }
      {% comment %} disable modal {% endcomment %}
      .product__modal-opener--image .product__media-toggle {
        pointer-events: none;
      }
      {% comment %} style for mobile {% endcomment %}
      @media screen and (max-width: 749px) {
        .product-single__photo {
          width: 100%;
        }
        .arrow_desktop_slider--prev, .arrow_desktop_slider--next {
          width: 35px;
          height: 35px;
        }
        
        .arrow_desktop_slider--prev{
          left: 1.5rem;
        }

        .arrow_desktop_slider--next{
          right: 1.5rem;
        }
      }
    </style>
    {% comment %} style end {% endcomment %}

Copy

In this code, you can also manually change the style settings for the arrow and the circle around it, its border, etc. (I usually just try changing the numbers, watching how it works on the site, and adjust the layout accordingly)

And finally, I have this code:

    <!--  custom arrow    -->
    {% if section.settings.gallery_layout == 'thumbnail_slider' %}
      <div class="arrow_desktop_slider">
        <button type="button" class="arrow_desktop_slider--prev slider-button slider-button--prev" name="previous">{% render 'icon-caret' %}</button>
        <button type="button" class="arrow_desktop_slider--next slider-button slider-button--next" name="next">{% render 'icon-caret' %}</button>
      </div>
    {% endif %}
    <!--  end custom arrow    -->

Copy

I have it right here:

fixed.