php - Get category ID in Magento Footer -


i want current category id in magento footer area can create condition things not shown in specific category. example want do: if current category 111 not show social icons

i tried following code:

<?php$current_id=  mage::getmodel('catalog/layer')->getcurrentcategory()->getid();echo $current_id;?> 

problem above code echo random id , doesnt change go thru different categories.

please help. thank you.

when don’t have access $this, can use magento registry:

$category_id = mage::registry('current_category')->getid(); 

or

get variable set on block xml

$this->getlayout()->getblock('product_list')->getcategoryid() 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -