In this post I am going to explain how to get list of store categories in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_storeManager; protected $_categoryCollection; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\ResourceModel\Category\CollectionFactory $categoryCollection, array $data = [] ) { $this->_storeManager = $storeManager; $this->_categoryCollection = $categoryCollection; parent::__construct($context,…


Recent Comments