$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category
$current_cat = $category->getId(); // current category id
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category
$current_cat = $category->getId(); // current category id
No comments:
Post a Comment