I want to get the subcategories of a main category using main category url.
I tried in this way in a function in my block.
$category = $this->_categoryFactory->create()->getCollection() ->addAttributeToFilter('url_key',$url_key);
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community