Limiting Variant Images Shown in Minimal Theme

Solved
Tourist
3 1 1

I need some help, We switched themes to the Minimal Theme and I need to limit the # of variant images shown on a product page to 8. We have some products that have 40+ images for our variants and it is making our listings look terrible. On our previous theme, I was able to edit the product template to limit the number of images to 8, and when someone selected the variant from the dropdown the image connected to that variant would appear. Now in our Minimal Theme, my fix isn't working. When someone selects the variant nothing appears unless it is the photo in the first 8. So, since it wasn't working I removed the changes I made to the product template, but I need help to figure out how to make it work. Does anyone know how to limit the number of displayed variant images to 8 in the Minimal Theme? Thanks

 

Here is my store: https://hope-design-ltd.myshopify.com

0 Likes

Success.

Astronaut
1094 150 274

Go into your product-template.liquid in your sections folder and find each instance of the forloop that outputs your images. It will look like this:

 

{% for image in product.images %}

You can add a limit to the loop. There are 2 occurrences of that in the code. Simply change them both to this:

 

{% for image in product.images limit: 8 %}

Should be good to go.

If my solution helped you, please like and accept as solution! ??
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Tourist
3 1 1

That works to change the number of images shown and it is the fix I tried previously. I am still having the issue with the images not showing when selected from the variant selector. The images are assigned to the correct variant in the product, but on the website, if they aren't in the 8 images being shown then they don't appear when selected by the customer. Does that make sense? 

 

Here is an example: https://www.hopedesignltd.com/products/brooch-10a?variant=31100049817702 

There are images associated with each variant, but you can't see them unless they are one of the 8 shown. 

0 Likes

Success.

Tourist
3 1 1

Nevermind. I figured it out. I removed the limit code from the variant section line 45, and now my issue seems fixed. Thanks

 

 

Screenshot 2019-11-14 at 1.25.45 PM.png

1 Like