Home » Magento, Magento 227 May 2016

Magento 2: Get list of all Categories & Store Categories

This article shows how we can get list of all categories and all category of current store in Magento 2.

Below is a block class of my custom module (Chapagain_HelloWorld). I have injected object of \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory and \Magento\Catalog\Helper\Category classes in the constructor of my module’s block class.


Now, we fetch and print the category collection.

Using Object Manager

Hope this helps. Thanks.

Magento 2

Get New Post by Email

Find me on

FacebookTwitterGoogle+LinkedInRSS Feed
  • Gael COAT

    Thanks Mukeh, very helpful !

  • Abdelkebir ELHARFALI

    Without using the Object manager is the best approach.