How to get third level deep of product categories on start page?

Hi!
I have problem like in subject.
How to get third level deep of product categories on start page? I can get only second level.

I’m want to get $osubcat->getSubCats() in categorylist.tpl and i can’t get it.

I’m traying to get:
-CATEGORY
–SUBCATEGORY
—SUBSUBCATEGORY <- this

@leofonic - i saw you made similar solution with your module multilevel. Would you help? :slight_smile:

Every Category can have Subcategories down to unlimited levels. You can get them with nested loops following the hierarchy.
E.g.

[{foreach from=$category->getSubCats() item=subcategory}]

    [{foreach from=$subcategory->getSubCats() item=subsubcategory}]

        [{foreach from=$subsubcategory->getSubCats() item=subsubsubcategory}]

etc.

Keep in mind that OXID only loads the top two levels of the category tree into the view. If you have more than two levels in your category tree, you need to extend the oxcategorylist object in a module and tell OXID to load the whole tree, e.g. like this:

class rageco_FullCategoryList extends rageco_FullCategoryList_parent
{
    public function __construct($sObjectsInListName = 'oxcategory')
    {
        $this->setLoadFull(true);
        parent::__construct($sObjectsInListName);
    }
}
1 Like

If you activate “Don’t show empty categories” in Backend/Performance, this forces oxid to loop through all categories and so oxid provides the deeper levels in categorylist without extending oxcategorylist.

1 Like

Thanks a lot guys! :slight_smile: