How to Get Category name in magento2 on product list page and category landing page:
We can get current category landing page detail in magento2 with the help of below script.
Below script will return the current category ID. Scritp is same as Magento1.x but here way of
declaring model is little different.
$registry = $objectManager->get('Magento\Framework\Registry'); $currentCatetory = $registry->registry('current_category'); echo $catId = $currentCatetory->getId();
CORNER OF BLOG:
“SAVE Agriculture !!! No Food without SOIL.“