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

Fatal Error when enabling Flat catalog
 
kimchi209
Member
 
Total Posts:  67
Joined:  2008-12-22
 

I decided to try and get the flat catalog working again (v 1.3) and though the enable flat catalog for product was greyed out I was able to enable the flat catalog for category. But when I surfed around a while eventually started getting this error on pages:

Fatal Error: Call to a member function count() on a non-object in /home/peaktope/public_html/app/design/frontend/degault/default/template/catalog/navigation/left.phtml on line 36

Any thoughts? I don’t see this listed as a bug anywhere though I did report it.

Image Attachments
flat-error.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
demonkoryu
Guru
 
Avatar
Total Posts:  328
Joined:  2008-11-26
Dortmund, Germany
 

This is probably a problem with the Luxe_Bestsellers module; the Flat Catalog and it aren’t compatible. IIRC there is a commercial version of the module which works with 1.3.0, just check the module’s page.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Crucial
Enthusiast
 
Avatar
Total Posts:  770
Joined:  2007-11-07
Phoenix, AZ
 

Open up that file and go to that line, you should have something like:

if($var->count())

Change it to this instead:

if(count($var))
 
Magento Community Magento Community
Magento Community
Magento Community
 
dilbert4life
Jr. Member
 
Total Posts:  27
Joined:  2008-11-21
 
Crucial - 01 May 2009 02:36 PM

Open up that file and go to that line, you should have something like:

if($var->count())

Change it to this instead:

if(count($var))

THANKS!!!

That works great. I was getting a different error – but similar. It wasn’t calling my $var, it was calling $_categories instead.
This is what it was:

<?php if($_categories->count()): ?>

And this is what I changed it too.

<?php if(count($_categories)): ?>

Thanks Crucial!

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