我创建了 1 个根类别和 2 个子类别
http://i.imgur.com/AEK3mO9.jpg
并创建新的静态块
http://i.imgur.com/TnM5Ucc.jpg
接下来我在中创建文件 categories.phtml
app/design/frontend/default/my_template/template/catalog/navigation
类别.phtml
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
?>
<div style="float: left; padding-right: 30px; text-align: center;">
<div class="linkimage">
<p>
<a href="<?php echo $this->getCategoryUrl($_category)?>">
<img src="<?php echo $immagine ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>" width="135" height="135" />
<?php echo $_category->getName()?>
</a>
</p>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
不工作!