如何在Magento中调整类别图像的大小?

bal*_*anv 5 magento

如何在Magento中调整类别图像的大小?我使用以下代码来调整产品图像的大小,但我无法使用它来显示类别图像:

$this->helper('catalog/image')->init($_product, 'small_image')->resize(170);
Run Code Online (Sandbox Code Playgroud)

Oğu*_*mir 5

如果我没有弄错的话,它应该是:

init($_product, 'small_image')->resize(100,100);

// single parameter work with 'image'
init($_product, 'image')->resize(100);

// How about this
$this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $image->getFile())->resize(100,100);
Run Code Online (Sandbox Code Playgroud)

这是新代码.如果您告诉我之前使用了哪个扩展,我们很快就会解决.如果我没有弄错,你使用了Template Monster Catalog Image Extension.所以,扩展内部有一个函数,如下所示.

// app/design/frontend/default/default/template/easycatalogimg/homepage.phtml
<?php echo Mage::helper('easycatalogimg/image')->resize($imageUrl, $width , $height) ?>
Run Code Online (Sandbox Code Playgroud)