Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. public function beforeLoadLayout($observer)
  2. {
  3.  
  4. $fullAction=$observer->getEvent()->getFullActionName()
  5. if($fullAction=='catalog_category_view'):
  6.  
  7. $currentCategoryId= Mage::getSingleton('catalog/layer')->getCurrentCategory()->getId();
  8.  
  9. $children = Mage::getModel('catalog/category')->getCategories($currentCategoryId);
  10. if(count(count($children)>0)){
  11. $observer->getEvent()->getLayout()->getUpdate()
  12. ->addHandle('cat_has_child_cat');
  13. }else{
  14. $observer->getEvent()->getLayout()->getUpdate()
  15. ->addHandle('cat_has_no_child_cat');
  16. }
  17. endif;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement