gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 05:03:05 25 4
gpt4 key购买 nike

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

$this->helper('catalog/image')->init($_product, 'small_image')->resize(170);

最佳答案

如果我没记错的话,应该是:

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);

这是新代码。如果你告诉我之前使用了哪个扩展,我们很快就解决了。
如果我没记错的话,您使用了 Template Monster Catalog Image Extension。因此,扩展内部有一个函数,如下所示。
// app/design/frontend/default/default/template/easycatalogimg/homepage.phtml
<?php echo Mage::helper('easycatalogimg/image')->resize($imageUrl, $width , $height) ?>

关于magento - 如何在 Magento 中调整类别图像的大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8711253/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com