Magento 2: Unable to resize the swatch image
-
22-03-2021 - |
Question
view.xml:
<image id="swatch_image_base" type="swatch_image">
<width>500</width>
<height>600</height>
</image>
<image id="swatch_image" type="swatch_image">
<width>500</width>
<height>600</height>
</image>
<image id="swatch_thumb" type="swatch_thumb">
<width>500</width>
<height>600</height>
</image>
<image id="swatch_thumb_base" type="swatch_thumb">
<width>500</width>
<height>600</height>
</image>
Swatch image is not resizing,it update the size of product image of size 213 x 300 when clicked on any configurable color swatches.
The output:
<img class="product-image-photo" src=" 213 x 300 size of image path " max-width="500" max-height="600" >
Please help me,if something missed here on view.xml file or any other way to do so.
Note: Done the cache clear, flushed the images, even deployed the static content.
La solution
On view.xml added this line
<image id="product_swatch_image_medium" type="image">
<width>500</width>
<height>600</height>
</image>
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange