Guest User

Untitled

a guest
Jan 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. protected $_categoryFactory;
  2. protected $_registry;
  3.  
  4. public function __construct(
  5. ....
  6. MagentoFrameworkRegistry $registry,
  7. MagentoCatalogModelCategoryFactory $categoryFactory
  8. ....
  9. ) {
  10. ....
  11. $this->_registry = $registry;
  12. $this->_categoryFactory = $categoryFactory;
  13. ....
  14. }
  15.  
  16. public function yourFunction()
  17. {
  18. $current_cat_id = $this->_registry->registry('current_category')->getId();
  19. $categoryData = $this->_categoryFactory->create()->load($current_cat_id);
  20. $getContent = $categoryData->getData('is_home_page'); //is_home_page = your attribute code
  21. echo $getContent;
  22. }
Add Comment
Please, Sign In to add comment