我创建了1个根类别和2个子类别
http://i.imgur.com/AEK3mO9.jpg
AND创建新的静态块
http://i.imgur.com/TnM5Ucc.jpg
接下来我在
中制作文件categories.phtmlapp/design/frontend/default/my_template/template/catalog/navigation
categories.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; ?>
不工作!
答案 0 :(得分:0)