【问题标题】:Change catalog images size magento更改目录图像大小 magento
【发布时间】:2013-03-24 21:31:05
【问题描述】:

我正在尝试更改目录图像的大小。我改变了css,也使用了resize函数

<?php 
<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(196); ?>" width="135" height="296" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" />
</a>

但它没有用。似乎我的模板具有声明的类别图像的属性。在代码中,类别产品的尺寸适用于它们:245x245。我一直在到处寻找改变它,但没有任何效果。我看到 magento go 可以让您覆盖后端任何目录图像的默认大小和比例。但我在社区中没有看到同样的情况..

【问题讨论】:

  • 请将您的代码放入``(esc.键下的按钮)或按{}代码按钮。
  • 您是否检查了显示的前端,可能是安装了一些覆盖默认属性的扩展。

标签: css image magento categories catalog


【解决方案1】:

图片的物理尺寸会发生变化,但是因为图片的宽高是用html设置的,所以不会改变。

改变

src="helper('catalog/image')->init($_product, 'small_image')->resize(196); ?>" width="135" height="296"

src="helper('catalog/image')->init($_product, 'small_image')->resize(196); ?>" width="196" height="196"强>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-07-13
    • 1970-01-01
    • 1970-01-01
    • 2012-03-22
    • 2017-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多