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

$category->getChildren() error
 
flowstack
Sr. Member
 
Avatar
Total Posts:  159
Joined:  2008-01-30
London, United Kingdom
 

The Category class (app/core/code/Mage/Catalog/Model) has a getChildren method which returns a comma separated list of category ids of child categories.

I’m trying to call this method on a category but I get a ‘cannot convert tree node to string’ error.

Anyone have any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

Sounds like you either tried to save it into a set string variable, or u tried die($returnedValue). if so try vardump($returnedValue); instead
Hope it helps =)

 
Magento Community Magento Community
Magento Community
Magento Community
 
flowstack
Sr. Member
 
Avatar
Total Posts:  159
Joined:  2008-01-30
London, United Kingdom
 

Thanks.

I think it is to do with the Tree Model not having been initialised for the particular category.

Just need to work out why now.

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