我们如何更改 Magento2 中属性样本图像的大小

How can we change size of an attribute Swatch image in Magento2

如何更改 Magento2 中的 product swatch image size

是否有任何选项可以更改 文件中的大小 /etc/view.xml

我得到了解决方案:

在/etc/view.xml文件中添加以下代码

<image id="swatch_image" type="swatch_image">
                 <width>38</width>
                 <height>38</height>
</image>

清除所有缓存类型并检查。

对我来说这没有用,但编辑以下文件可以:

/vendor/magento/module-swatch/etc/module.xml

我使用的是带有 Porto 主题的 M2.1.2。

这在 magento 2.3 https://github.com/magento/magento2/issues/2978#issuecomment-171610891 中已修复。

更新到 Magento 2.3 将解决该问题。