我卸载了一个扩展程序,之后我在类别页面上显示的所有产品图片都调整为 135x135 而不是 209x209。我检查了 list.phtml
,这是我发现的:
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this- >stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(209); ?>" width="209" height="209" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
尽管这在我看来是正确的,但我也发现了一个随机的 css 属性,它似乎是罪魁祸首,但我只是找不到规则的任何来源。
img[Attributes Style] {
width: 135px;
height: 135px;
}
可以看到我的问题here
最佳答案
扩展正在覆盖产品列表的模板,因此您修改的文件 ( list.phtml
) 实际上不是显示的内容。
如果您有任何影响产品列表页面的扩展,请检查它们在布局 xml 文件中是否有如下所示的内容:<action method="setTemplate"><template>XXX.phtml</template></action>
.
关于php - Magento 产品图片未调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17972394/