There are a few different ways that you can hide product variant images on Shopify. The first way is to go into the settings for your product and uncheck the “Variant Image” option.
This will hide all variant images from your product page. Another way to hide variant images is to add some code to your theme.liquid file. You can add the following code to your theme.liquid file:
< style >
.product-single__variant-image {display: none;}
< /style >
This code will hide all variant images on your product pages. If you only want to hide certain variant images, you can use CSS selectors to Target specific variants. For example, if you only want to hide the image for the “small” size variant, you can use the following code:
1. Go to the ‘Settings’ section of your Shopify admin panel.
2. In the ‘Checkout’ tab, scroll down to the ‘Product Page’ section and look for the ‘Variant Images’ setting.
3. Change the setting from ‘Show all variant images’ to ‘Hide all variant images’.
4. Save your changes and you’re done!
< style >
.product-single__variant-image–small {display: none;}
< /style >
You can also use JavaScript to hide variant images. For example, you could add the following code to your product pages:
< script >
document.getElementsByClassName(‘product-single__variant-image’).style.display = ‘none’;
< /script >
< script > document.getElementsByClassName(‘product-single__variant-image–small’).display = ‘none’; < /script >