Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function beforeLoadLayout($observer)
- {
- $fullAction=$observer->getEvent()->getFullActionName()
- if($fullAction=='catalog_category_view'):
- $currentCategoryId= Mage::getSingleton('catalog/layer')->getCurrentCategory()->getId();
- $children = Mage::getModel('catalog/category')->getCategories($currentCategoryId);
- if(count(count($children)>0)){
- $observer->getEvent()->getLayout()->getUpdate()
- ->addHandle('cat_has_child_cat');
- }else{
- $observer->getEvent()->getLayout()->getUpdate()
- ->addHandle('cat_has_no_child_cat');
- }
- endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement