【问题标题】:Display categories on Magento在 Magento 上显示类别
【发布时间】:2013-07-21 18:20:15
【问题描述】:

我创建了 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

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

不工作!

【问题讨论】:

    标签: magento magento-1.7 categories


    【解决方案1】:

    您的配置可能有问题,可能在列表页面中

    这里有很好的文档,可以通过图形理解来列出 cms 块中的类别数量

    直接扔this article就可以轻松解决问题

    希望这对您有所帮助。

    【讨论】:

      猜你喜欢
      • 2015-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多