Select product variants by clicking their images

Normally, variants are selected from a drop-down menu. You might want your customers to be able to select a product variant by clicking a variant image.

Click change variant


This solution will not work in the themes Boundless, Brooklyn, Jumpstart, and Lookbook. If you use the Solo theme, the solution will work, but you will need to edit your single-product.liquid snippet, rather than your product.liquid template. If you use the Venture theme, the solution will work, but you will need to add your code before the </body> tag in theme.liquid , rather than to your product.liquid template.


Most themes update the main image when a variant with an image is selected. The update never happens in both directions though, because having a change of the main image automatically update a variant selection may confuse shoppers into adding the wrong variant to the cart. So, proceed with caution in applying this customization to your store.

To select product variants by clicking a variant image:

  1. From your Shopify admin, click Online Store, and then click Themes (or press G W T).

  2. Find the theme you want to edit, click the ... button, and then click Edit HTML/CSS.

  3. Under Templates, click product.liquid. (If your theme is Solo or Venture, look at the note above.)

  4. Copy all the code in this file hosted on GitHub.

  5. Paste the copied code at the very end of the product.liquid template.

  6. Click Save.


This customization will not work with all themes. If the above guide does not work with your theme, you should hire a Shopify Expert to help implement this solution for you.

Want to discuss this page?

Visit the Shopify Community