change default picture instead of being a variant

change default picture instead of being a variant

ImStillLearning
Excursionist
51 0 6

Hello

 

Just wanting to see if any one knows how to make the default picture be the first instead of the first variant. I am using the Ride theme and its been updated.

 

I have tried many of the other methods I have found on these boards and one works but doubles up on the default picture.

 

Thank you

Replies 4 (4)

NomtechSolution
Astronaut
1245 113 160

Add this code in theme file

<div class="product-single__photos product-photos" data-product-single-photos>
  {% for image in product.images %}
    {% if image == product.selected_or_first_available_variant.featured_image %}
      <div class="product-single__photo-wrapper">
        <img src="{{ image.src | img_url: '1024x1024', scale: product_image_scale }}" alt="{{ image.alt | escape }}">
      </div>
    {% endif %}
  {% endfor %}
</div>
ImStillLearning
Excursionist
51 0 6

Thank you for your reply.

 

Do I just add this to the bottom of the theme.liquid file?

ImStillLearning
Excursionist
51 0 6

I ended up adding it and the main image (the bigger image) disappeared.

antnonymous
Visitor
1 0 0

2 years later and no one has a solution for you? I can't find a proper solution anywhere online. I'm thinking of just changing the theme at this point.