0
我想要显示主页上的所有主要类别与图像。我为达特写下面的代码,但它不是显示图像。如何在magento主页上显示主要类别图像?
<?php
$_helper = Mage::helper('catalog/category');
$_categories = $_helper->getStoreCategories();
foreach ($_categories as $_category):
$_categoryThumb = $_category->getThumbnail();
echo $_category->getImageUrl();
?>
<li>
<h2> <a href="<?php echo $_helper->getCategoryUrl($_category) ; ?>">
<img src="<?php echo $this->getUrl() . 'media/catalog/category/' . $_categoryThumb; ?>" alt="<?php echo $_category->getName()?>"/>
</a>
</li>
<?php endforeach; ?>