I have a problem while doing search in magento store...
Getting following error:
Fatal error: Call to a member function getId() on a non-object in
The line that is giving error is the last line in the below code:
Code I used is:
<?php
$_productCollection=$this->getLoadedProductCollection();
$_productCollection->addAttributeToSelect('news_from_date')
->addAttributeToSelect('news_to_date');
$_helper = $this->helper('catalog/output');
$store = Mage::app()->getStore();
$code = $store->getCode();
?>
<?php $_helper = $this->helper('catalog/output');?>
<?php $_category_detail=Mage::registry('current_category');?>
<?php
$products_count = Mage::getModel('catalog/category')->load($_category_detail->getId())->getProductCount();
?>