Image Magento 1.9.0.1图像大小

Image Magento 1.9.0.1图像大小,image,magento,image-size,Image,Magento,Image Size,我正在使用Magento 1.9.0.1 当我进入类别查看产品时,所有产品都显示在方形框中。 由于我的图像是矩形的,我可以看到图像左右两侧的空白 请建议如何编辑代码,使图像显示为矩形(高:300px宽:200px) 谢谢看一看@ /app/design/frontend/default/{theme}/template/catalog/product/list.phtml 更改大小(宽度、高度) helper('catalog/image')->init($_product,'small_ima

我正在使用Magento 1.9.0.1

当我进入类别查看产品时,所有产品都显示在方形框中。 由于我的图像是矩形的,我可以看到图像左右两侧的空白

请建议如何编辑代码,使图像显示为矩形(高:300px宽:200px)

谢谢

看一看@

/app/design/frontend/default/{theme}/template/catalog/product/list.phtml

更改大小(宽度、高度)

helper('catalog/image')->init($_product,'small_image')->调整大小(158150);?>
看一看@

/app/design/frontend/default/{theme}/template/catalog/product/list.phtml

更改大小(宽度、高度)

helper('catalog/image')->init($_product,'small_image')->调整大小(158150);?>

将此代码用于list.phtml文件中的产品图像(
app/design/frontend/[current package]/[current theme]/template/catalog/product/list.phtml

helper('catalog/image')->init($_product,'small_image')->keepFrame(false)->resize($width,$height);?>

希望这有帮助!谢谢。

将此代码用于list.phtml文件中的产品图像(
app/design/frontend/[current package]/[current theme]/template/catalog/product/list.phtml

helper('catalog/image')->init($_product,'small_image')->keepFrame(false)->resize($width,$height);?>

希望这有帮助!谢谢。

但是这只改变了类别页面上的图像大小。当我在主页上查看新产品部分时,图像框仍然是方形的,没有改变。你能告诉我为什么会这样吗?我怎样才能改变这些图片呢。谢谢,我终于找到了你建议的密码。您是明星,但这仅更改了类别页面上的图像大小。当我在主页上查看新产品部分时,图像框仍然是方形的,没有改变。你能告诉我为什么会这样吗?我怎样才能改变这些图片呢。谢谢,我终于找到了你建议的密码。你是明星嗨,我假装也一样。但是大小没有改变。图像源看起来像/product/cache/7/small_image/240x318/17f82f742ffe127f42dca9de82fb58b1/i/m/img14.jpg。但在悬停这些图像时,其宽度仍显示为218。我能做什么?你有任何类型的页面缓存启用吗?没有,我没有启用任何东西。我期望的是产品图片的宽度为240px,高度为318px。嗨,我假装是一样的。但是大小没有改变。图像源看起来像/product/cache/7/small_image/240x318/17f82f742ffe127f42dca9de82fb58b1/i/m/img14.jpg。但在悬停这些图像时,其宽度仍显示为218。我能做什么?你有任何类型的页面缓存启用吗?没有,我没有启用任何东西。我所期望的是产品图像的宽度应为240px,高度应为318px。
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(158, 150); ?>
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->keepFrame(false)->resize($width, $height); ?>