I am retrieving a url for each image in a custom category view:
Like so:
foreach ($collection as $cat){
$cur_category = Mage::getModel('catalog/category')->load($cat->getId());
$_img = $cur_category->getImageUrl();
//stuff
}
This is giving me the original image, I would like to resize using Magento’s built in resize function. But I’m a newb, and can’t figure out how to get that code to work like the code on the product list page:
$this->helper('catalog/image')->init($_product, 'small_image')->resize(306);
How do I modify/use the original code to make it resize the images? Thanks!
There is no built in functionality for resizing category images. However you can utilize
Varien_Imageclass. Here I wrote a piece of code you need: