Magento :: 类别和子类别

发布于 2024-10-26 10:16:49 字数 460 浏览 2 评论 0原文

请任何人都可以帮助我如何设计类别和子类别列表,如下
http://www.officemax.com.au/office-supplies/writing.html

PS:: Magento 默认设计是当您单击某个类别时,它会直接列出该类别中的所有产品。我真正想做的是,它应该在页面中首先列出所有子类别,如上面的示例网站 http://www.officemax.com.au/office-supplies/writing.html,然后列出该子类别的所有相关产品,

如果有人可以帮助我,我将不胜感激。

Please anyone can help me how to design category and subcategory listing as below
http://www.officemax.com.au/office-supplies/writing.html

PS:: Magento default design is when you click a category it will list all products in that category straight. What I really want to do is , it should list all the subcategories first in the page like the above sample site http://www.officemax.com.au/office-supplies/writing.html and then list all relevent products of that subcategories

I will greatly appreciate if some one can help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情域 2024-11-02 10:16:49

类别中的子类别 - 这是示例,您应该自定义

1.- 在 app/design/frontend/base/default/template/catalog/navigation< 中创建一个名为 subcategory.phtml 的页面/em> 文件夹并添加以下代码段:

<?php $_categories = $this->getCurrentChildCategories(); ?>
<?php foreach ($_categories as $_category): ?>
<?php if($_category->getIsActive()): ?>
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?></a>
<?php endif; ?>
<?php endforeach; ?>

2.- 创建一个名为“MySubcategory”的静态块,并将以下代码放入内容中:

{{block type="catalog/navigation"  template="catalog/navigation/subcategory.phtml"}} 

3.- 现在转到您要用来显示子类别的类别并确保该类别未设置为“锚点”。在显示选项选项卡中,将其设置为显示为“仅静态块”并选择块“MySubcategory

Sub Categories within Categories - This is sample, you should customize

1.- Create a page called subcategory.phtml in the app/design/frontend/base/default/template/catalog/navigation folder and add following code piece :

<?php $_categories = $this->getCurrentChildCategories(); ?>
<?php foreach ($_categories as $_category): ?>
<?php if($_category->getIsActive()): ?>
<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?></a>
<?php endif; ?>
<?php endforeach; ?>

2.- Create a static block called "MySubcategory" and put the following code into content :

{{block type="catalog/navigation"  template="catalog/navigation/subcategory.phtml"}} 

3.- Now go to category which you would like to use to show sub categories and ensure that category not set as an "anchor". In the display option tab, set it to show as "Static Block Only" and choose the block "MySubcategory"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文