我想获取类别图片:
<?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; ?>
只需调用类别模型即可:
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; ?>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句