0
A
回答
1
我一直在使用Vertical Navigation来做类似的事情。
0
正式的方式来为自己做,这是使用该模块造物主(搜索Magento的连接此),然后创建一个模块:
创建一个包含以下代码的新PHTML文件:
$storeCategories = $this->getCats('my-category-url-key');
foreach ($storeCategories as $category):
echo '<li><a href="' . $category->getUrl() . '">' . $category->getName() . '</a></li>';
endforeach;
然后一个叫(说)块Namespace_Yourmodule_Block_Singlecat
用下面的代码:
public function getCats($catName)
{
$parent = Mage::getResourceModel('catalog/category_collection')
->addAttributeToSelect('entity_id')
->addAttributeToFilter('url_key', $catName)
->getFirstItem();
return $storeCategories = Mage::getModel('catalog/category')
->getCategories($parent->getId(), $recursionLevel=1, $sorted=false, $asCollection=true, $toLoad=false);
}
然后你只需要插入以下节点到app\design\frontend\yourtheme\layout\yourmodule.xml
布局文件:
<reference name="left">
<block type="yourmodule/singlecat" name="singlecat" template="path/yourfilename.phtml" />
</reference>
交叉手指,祈祷你所选择的神性和Magento的可能微笑在你的代码:)
相关问题
- 1. magento显示页面左侧边栏上的类别
- 2. 在magento的左栏显示类别
- 3. 在Magento主页上显示的类别
- 4. Magento类别在主页上不显示
- 5. 侧边栏中的magento子类别
- 6. Magento 2:添加类别边栏
- 7. Magento 1.7.0.2 - 显示图片类别上面2栏左页
- 8. Magento:类别显示错误的订单
- 9. 显示一个侧边栏别的不显示任何侧边栏
- 10. MAGENTO - 如何在类别页面上显示子类别产品?
- 11. Magento在类别list.phtml上显示子类别描述
- 12. Magento边栏母公司类别和子类别永久
- 13. 未显示Magento类别。
- 14. Magento类别不显示
- 15. magento子类别显示
- 16. 为什么不能在一个magento主题上显示一个类别菜单?
- 17. 如何在栏目中显示magento产品类别
- 18. 在magento主页上显示多个类别产品
- 19. 显示与类别,子类别和产品菜单 - Magento的
- 20. Magento - 菜单显示类别和产品类别
- 21. Woocommerce在特定类别的边栏中显示产品
- 22. 边栏的类别和标签不显示在WordPress的了
- 23. 向Magento 2主页添加一个左侧类别侧边栏
- 24. 如何在magento的单个页面上显示所有类别及其产品
- 25. Magento - 无法获取侧栏导航以在类别页面上显示
- 26. Magento的:显示级别currenty类别树
- 27. Magento的显示在类别列表
- 28. 在Magento中显示类别的问题
- 29. Magento - 显示个别产品
- 30. 单篇文章边栏(基于类别)