我正在使用 Fishpig Wordpress 扩展的 Magento 网站上工作。我们在左侧边栏中显示了类别小部件,它被设置为显示层次结构。
它的工作深度为两级(即 ul & li's with .level0
& .level1
),但未显示深度为 3 级的类别,即level2
我已经在基本的 wordpress 安装上对此进行了测试,我可以让它显示 3 级以下的类别,但我无法让它在带有 fishpig WordPress 集成的 Magento 上工作。我已将帖子分配给所有子类别。
我看到template/wordpress/sidebar/widget/categories.phtml
有这个代码块来获取 level1 子类别:
<?php else: ?>
<?php foreach($categories as $category): ?>
<li class="level0 item<?php if ($this->isCurrentCategory($category)): ?> active<?php endif; ?>">
<a class="level0" href="<?php echo $category->getUrl() ?>" title="<?php echo $category->getName() ?>">
<?php echo $category->getName() ?>
</a><?php if ($this->getCount()): ?> (<?php echo $category->getPostCount() ?>)<?php endif; ?>
<?php if ($this->getHierarchical()): ?>
<?php $children = $children = $category->getChildrenCategories() ?>
<?php if (count($children) > 0): ?>
<ul class="level1">
<?php foreach($children as $child): ?>
<?php if ($child->getPostCount() > 0): ?>
<li class="level1 item<?php if ($this->isCurrentCategory($child)): ?> active<?php endif; ?>">
» <a href="<?php echo $child->getUrl() ?>" title="<?php echo $child->getName() ?>" class="level1"><?php echo $child->getName() ?></a><?php if ($this->getCount()): ?> (<?php echo $child->getPostCount() ?>)<?php endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
<?php endif; ?>
有没有办法使用 Fishpig 在 Magento 上显示两个以上级别的 wordpress 类别?