Select 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.

To select product variants by clicking a variant image:
From your Shopify admin, go to Online Store > Themes.
Find the theme you want to edit, and then click Actions > Edit code.
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
From the Shopify app, tap Store.
In the Sales channels section, tap Online Store.
Tap Manage themes.
Find the theme you want to edit, and then click Actions > Edit code.
In the Sections folder, open the
product-template.liquid
template. (If your theme is Venture, see the note above.)Copy all the code in this file hosted on GitHub.
Paste the copied code at the bottom of the
product-template.liquid
template.Click Save.
Open the
theme.js
ortheme.js.liquid
file in your Assets folder.Copy all the code in this file hosted on GitHub.
Paste the copied code at the bottom of the
theme.js
ortheme.js.liquid
file.Click Save.