3

what I need is to hide all pics that doesn't bellongs to the selected color in swatch of configurable product, is there any way to achieve this? Thanks.

I've seen this similar question, but without any answer.

6

I get this using etc/view.xml file in my theme, with this configuration:

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

The Luma Theme default value is prepend. This link brings more information.

| improve this answer | |
  • Isn't replace the default behaviour? – Daan van den Bergh Sep 4 '18 at 9:51
  • Hi, actually I don't remember the Luma default ... but in our custom theme prepend was the default at that time. – lpFranz Sep 4 '18 at 12:34
  • Oh, sorry. I believe in Blank the default is replace and Luma overrides it. Anyway, thanks for sharing. +1 – Daan van den Bergh Sep 4 '18 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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