简体   繁体   中英

How to list Magento sub categories and their products on category/view.phtml

I am pretty new to magento and have gotten my design implemented, but I am struggling with a category/product listing issue.

My categories are like this

Parent
   Child
      Grandchild 1
         Product 1
         Product 2
      Grandchild 2
         Product 1
         Product 2

I have the top level nav with a drop down listing the children available on all pages, but once you navigate to the child I want it to list each grandchild category and the relevant products.

The store is going to be kept pretty small so we're talking about 5-10 products per grandchild category.

The site is at http://gasworksparkkiteshop.com any advice would be massively helpful. I am also using customizing a copy of the Modern theme.

Look in your theme's catalog.xml file. You should find something like this,

<catalog_category_default translate="label">
    <label>Catalog Category (Non-Anchor)</label>
    <reference name="left">
        <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
    </reference>
    ...

Your site doesn't have a left block that I can see so the above code does nothing. Try changing the reference to a location that is in use, or in the 2columns-right.phtml insert the errant left column where you want the navigation block to appear.

<?php echo $this->getChildHtml('left') ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM