Magento类图像

时间:2014-03-05 10:08:38

标签: php image magento categories

我想获得分类图片:

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

1 个答案:

答案 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; ?>