I’m running into a bit of a dilemma. When I use the drop-down or button menu (depending on theme editor) to select variants, the images, pricing, name, etc. change just fine. However, when a different thumbnail is selected, the image changes, but the variant does NOT.
This could cause confusion and/or incorrectly purchased items by customers seeing one large color image, but in actuality, another item going to the cart. From what I have been reading, this is a common issue with some themes. I have gone through dozens of similar discussion threads to try solutions and also the Shopify Help Center code which was only for vintage themes. The creator of the Label theme said that feature is not available and couldn’t help to remedy the issue.
Here are the instructions. Choose option 1 or option 2 depending on what you prefer, they are written to only work if the product has variant options. Obviously you can’t paste both codes at the same time.
Go to your theme’s “Edit Code” Option, then in the search bar type “theme.liquid”
Below the tag “” tag paste the following. Screenshot attached for reference.
Option 1:
Option 2:
Screenshot is for reference only, the correct code to paste is the one shown above.
I eventually figured out an alternative solution and added the variant images to the variant selector buttons. I was having little luck making the thumbnails near the main image work to choose variants. Decided to post an update on here since it can sometimes be hard to find answers on this forum, and hopefully it can help someone else.
I moved the thumbnails to the left of the main image and used code to HIDE the images not associated with a variant. The corresponding variant images and names were then coded into the variant selector buttons.
There may be a better/cleaner way to write the code, however it works perfectly for me. The code associated with the variant selector is posted at the very bottom of this post.
Thanks for sharing your solution to this situation, as it is also a problem for my website. Your custom solutions is what I had in mind, so now I have a direction to approach this from.