In this post I am going to explain how to get sub categories of specific category in magento 2. 1. Using Dependency Injection Add below code snippet in Block class. protected $_categoryFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, array $data = [] ) { $this->_categoryFactory = $categoryFactory; parent::__construct($context, $data); } /* Get category object…


Recent Comments