Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- protected $_categoryFactory;
- protected $_registry;
- public function __construct(
- ....
- MagentoFrameworkRegistry $registry,
- MagentoCatalogModelCategoryFactory $categoryFactory
- ....
- ) {
- ....
- $this->_registry = $registry;
- $this->_categoryFactory = $categoryFactory;
- ....
- }
- public function yourFunction()
- {
- $current_cat_id = $this->_registry->registry('current_category')->getId();
- $categoryData = $this->_categoryFactory->create()->load($current_cat_id);
- $getContent = $categoryData->getData('is_home_page'); //is_home_page = your attribute code
- echo $getContent;
- }
Add Comment
Please, Sign In to add comment