I am currently getting category image with the following code:
<li class="item <?= $class ?> sub-cat-items">
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->
htmlEscape($_category->getName()) ?>"><img src="<?php echo
$_category->getImageUrl() ?>" width="580" alt="<?php echo
$this->htmlEscape($_category->getName()) ?>" /></a>
<h1><?php echo
$this->htmlEscape($_category->getName()) ?></h1>
</li>
But i want to get thumbnail instead of main category image i have tried like this but not working:
<?php
$_categories = $this->getCurrentChildCategories();
if ($_categories->count()):
$categorycount = 0;
foreach ($_categories as $_category):
if ($_category->getIsActive()):
$cur_category = Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
$catName = $this->getCurrentCategory()->getName();
if ($categorycount == 0) {
$class = "first";
} elseif ($categorycount == 3) {
$class = "last";
} else {
$class = "";
}
echo Mage::getModel('catalog/category')->load($cur_category)->getThumbnailImageUrl(). 'echo';
?>
Best Answer
Try this updates.