Change Image Size of Swatches in Magento 2

color-swatchesmagento2swatchesxml

I found the file to change the image size of Swatches here and it works when I change it in that place:

vendor/magento/module-swatches/etc/view.xml

However, if I move it to my theme it doesn't overwrite the file and doesn't work. My path to override is:

app/design/frontend/name/themename/Magento_Swatches/etc/view.xml

Is this path wrong? Do etc files have a different path to be placed than phtml files?

Best Answer

You have to apply changes under app/design/frontend/{Package}/{themename}/etc/view.xml file.

For changes value of swatches you have to add your tag inside view.xml files

<media>
        <images module="Magento_Catalog">
             <image id="swatch_image" type="swatch_image">
                 <width>50</width>
                 <height>30</height>
             </image>
        </images>
</media>

You can keep your specific field inside images tag.

Now applying changes you have to clear cache and var folder.

Related Topic