Hello Magento Pals ?,
This technical blog fixes the problem of Show Double Thumbnail Image When Select Configurable Products in Magento 2. Previously I shared How to Add Custom Layout Dropdown on CMS Page after Magento 2.3.4. Let’s look at the issue elaborately and solve it ?
Magento 2 supports different product types to bifurcate wide range of products accordingly. One of the product types is a configurable product, that provides options like color, size, etc. The options contain separate SKUs. Let us find out the problem with configurable products in Magento 2.
Contents
Problem:
Configurable products are added from the admin panel and the images are allocated to each option. Within the product page in the frontend, it shows thumbnails of different images of the product. But as the other option is selected like color or size, it shows repeated thumbnails. This affects the user experience of your store. Thus, the below-mentioned solution will help to overcome this issue.
Solved: Magento 2 Show Double Thumbnail Image When Select Configurable Products
Step 1: Go to the following path
app\design\frontend\Themes\Yourtheme\etc\view.xml
Step 2: Find below code
1 2 3 4 5 |
<vars module="Magento_ConfigurableProduct"> <var name="gallery_switch_strategy">prepend</var> </vars> |
Replace it with below code :
1 2 3 4 5 |
<vars module="Magento_ConfigurableProduct"> <var name="gallery_switch_strategy">replace</var> </vars> |
That is it.
Conclusion:
Hence, with the above solution, manage your configurable products’ thumbnails in Magento 2 store. In case of any doubts, you can ask me in the comment part. Also, do share the solution with your Magento friends. See you next time. Until then stay connected for more such solutions.
Happy Fixing ?
I tested this method and it doesn’t work anymore.
https://magento.stackexchange.com/questions/339442/magento-2-4-2-how-to-hide-duplicate-pictures-when-the-product-color-is-switched
Kindly confirm you implemented it properly. which error you are facing here? what is your Magento version?