Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Mage::registry(’current_category’) throws “Call to a member function getDescription() on a non-object”
 
QuattroPorte
Jr. Member
 
Avatar
Total Posts:  19
Joined:  2008-03-08
 

I’m experiencing a strange issue which with “Mage::registry(’current_category’)”.
I have the following code in app/design/frontend/default/my_site/template/catalog/product/view.phtml:

<?php 
    $currentCategory 
Mage::registry('current_category');
    if( 
$_description $currentCategory->getDescription() ): ?>
        
<h4><?php echo $this->__('Some Description Title'?></h4>
        <
class="category-description"><?php echo $_description ?></p>
<?php endif; ?>

This code works as expected in FireFox but throws a “Fatal error: Call to a member function getDescription() on a non-object” in IE (and Safari).

Does anybody have a clue why this might be?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ThadBry
Jr. Member
 
Total Posts:  27
Joined:  2008-12-18
 

I know it’s late, but for anyone trying to figure this out.  The correct $key for Mage::register() is ‘current_category’, not ‘current category’.  Use the underscore ( ‘_’ )

 
Magento Community Magento Community
Magento Community
Magento Community
 
CharlieXun
Jr. Member
 
Total Posts:  30
Joined:  2009-04-12
 

well in the post of QuattroPorte, it did use Mage::registry(’current_category’).
I also faced this problem. Anyone got the reason why category object is not found?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danisoft
Jr. Member
 
Total Posts:  1
Joined:  2009-07-30
 

Hi All:
My problem is that I want to show all sub categories of a particular category. But when I click on any of the sub category I am unable to see the products under that category. Can any one help me please.

In simple words All I want is that on home page sub categories of a category should be displayed in left bar and when click on a sub category the products of that sub category should be displayed as usual.

Waiting for a reply.

DANI

 
Magento Community Magento Community
Magento Community
Magento Community
 
mchira
Jr. Member
 
Total Posts:  1
Joined:  2010-05-25
 

I have something similar to this related to tracking shipments.
“Call to a member function getTrackingInfo() on a non-object in <path>” on line: “return Mage::registry(’current_shipping_info’)->getTrackingInfo();” [this is the actual line throwing the error]

if anyone has any idea…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top