1

I used to seek workarounds for magento 2.4.2 on the stackexchange that fixed this issue, but when I upgraded to magento 2.4.5, those workarounds were outdated because magento had a major upgrade.

How can I re-solve this problem, thank you all.

Magento 2.4.2 How to hide duplicate pictures when the product color is switched

enter image description here enter image description here enter image description here

2 Answers 2

0

The solution still is the same, I've tested in magento 2.4.5:

Adding these lines of code to the theme view.xml file: < your theme dir>/etc/view.xml

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

your theme view.xml will be looks like this:

<?xml version="1.0"?>
<view xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/view.xsd">
    <vars module="Magento_ConfigurableProduct">
        <var name="gallery_switch_strategy">replace</var>
    </vars>
</view>

You can read more here: https://github.com/magento/magento2/blob/2.4.5/app/code/Magento/ConfigurableProduct/README.md#configurable-variables-through-the-theme-viewxml

2
  • Thank you, but still can't fix this problem.
    – Angelo
    Commented Oct 5, 2022 at 8:00
  • Good news. Magento Open Source no longer displays duplicate images when the product color is changed on a product detail page.
    – Angelo
    Commented Aug 14 at 16:30
0

I raised this issue with the official, and it has been resolved in the latest version (2.4.7).

https://github.com/magento/magento2/issues/36243

Magento Open Source no longer displays duplicate images when the product color is changed on a product detail page.

https://experienceleague.adobe.com/en/docs/commerce-operations/release/notes/magento-open-source/2-4-7#catalog

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.