我想获得分类图片:
<?php foreach ($this->getCurrentChildCategories() as $_category): ?>
url: <?php echo $_category->getURL() ?>
name: <?php echo $this->htmlEscape($_category->getName()) ?>
img: <?php echo $_category->getThumbnail() /// returns nothing ?>
<?php endforeach; ?>
答案 0 :(得分:1)
只需打电话给类别模型:
Mage::getModel('catalog/category')->load($_category->getId())->getThumbnail()
这样:
<?php foreach ($_categories as $_category): ?>
url: <?php echo $_category->getURL() ?>
name: <?php echo $this->htmlEscape($_category->getName()) ?>
img: <?php echo Mage::getModel('catalog/category')->load($_category->getId())->getThumbnail() ?>
<?php endforeach; ?>