Possible Duplicate:
Any reason why Mage::registry(‘current_category’) would return NULL?
Reference – What does this error mean in PHP?
Fatal error: Call to a member function getParentCategory() on a non-object in…
the code:
$_category_detail=Mage::registry('current_category');
$id=$_category_detail->getParentCategory()->getId();
now, when the page can’t use getParentCategory() i using the following but can’t work.
if( isset(getParentCategory()){
$id=$_category_detail->getParentCategory()->getId();
}
why? thank you
You need to use
method_exists()rather than trying to call a non-existent function: