A lot of times I’ve found the need to create a “Shop” page that shows the root category as an anchor (with layered navigation, for example). There are also a couple questions floating around on Stackexchange about how to have root categories be shown like normal categories.

By default Magento won’t show the root category for reasons I’ve still not found out.

There are a lot of modules that have that functionality, like Amasty’s Improved Navigation. However, it turns out it’s also pretty easy to do yourself.

In the Mage_Catalog_CategoryController::_initCatagory (yes, it’s spelled wrong) there is the following check:

As for the initCatagory method, copy the original parent method, and comment out the canShow check.

In addition to that, replace the following line:

$categoryId = (int) $this->getRequest()->getParam('id', false);

... with:

$categoryId = Mage::app()->getStore()->getRootCategoryId();

That should be it to show the root category products as a normal category page.

The cool thing about this is the abstraction between layout handles and controllers, so everything will still work even though we're using a different controller. Even Lesti_Fpc will cache your custom controller out of the box because it matches with the catalog_category_view full action name handle.

Hi there, I'm Erfan - a full-stack Magento developer and consultant living in Perth, Australia. I'm the organiser of Western Australia's Magento meetup and at the moment I'm working at SPEQS, a startup that will revolutionise how people buy eyewear online.