I want to hide the configurable product images when a configurable swatch is clicked.

So by default configurable shows Green, red and blue.

And when I select Blue swatch of my simple product only Blue products images should show.


1 Answer 1


Try to use etc/view.xml file in your theme, with this configuration:

<vars module="Magento_ConfigurableProduct">
   <var name="gallery_switch_strategy">replace</var>

The Luma Theme default value is prepend.

See this question and this link.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.