When i am trying to search any product name in mobile rwd theme then i am getting the below error.
Fatal error: Call to a member function getId() on a non-object in /home3/wowdeals/public_html/app/design/frontend/rwd/rwd-ariel/template/catalog/product/list.phtml on line 51
Here is a piece of code:
<?php
$_category = Mage::registry('current_category');
$currentCategoryId= $_category->getId();
// echo $currentCategoryId;
$_productCollection = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToSelect('*')
->addCategoryFilter($_category)
->setOrder('price', 'ASC')
->load();
?>
Kindly help me.