Magento 2.4.2 How to hide duplicate pictures when the product color is switched
Hi everyboby,
When the product is configurable, the default picture will be displayed repeatedly when switching colors. How to hide duplicate pictures when the product color is switched.
How did you solve it?
Examples are here https://pearl.weltpixel.com/v5/leah-yoga-top.html



-
Hi everyboby,
I found a solution, modify your magento2.4.2 view.xml
app/design/frontend/yourtheme/yourtheme/etc/view.xml
<vars module="Magento_ConfigurableProduct"> <var name="gallery_switch_strategy">prepend</var> </vars>
change into
<vars module="Magento_ConfigurableProduct"> <var name="gallery_switch_strategy">replace</var> </vars>It works fine.
Please sign in to leave a comment.
Comments
1 comment