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 browse page not working after upgrade
 
MartinaL
Sr. Member
 
Total Posts:  82
Joined:  2008-03-31
 

I have this page which displays for my top level category that displays a grid with a small image and the name of the subcategories but since the upgrade to 1.3.0 i get the following error;

Fatal error: Call to a member function getChildrenNodes() on a non-object in /var/www/fastclick/app/design/frontend/fastclick/default/template/catalog/navigation/browseShop.phtml on line 86

This is the page code;

<?php
$iCol 
1;
$categories_per_row 5;
$cellwidth intval100 $categories_per_row ); 
$_main_categories=$this->getStoreCategories();
if(
$_main_categories->count()):
?>
<table width="100%" cellspacing="0" cellpadding="0" style="margin-top: 20px;">
    
<?php
    
if ($iCol == 1// this is an indicator wether a row needs to be opened or not
        
echo "<tr>\n";
    
}
    
foreach ($_main_categories as $_main_category):
        if(
$_main_category->getIsActive()):
            
$_sub_categories=$_main_category->getChildren();
            foreach (
$_sub_categories as $_sub_category):
                if(
$_sub_category->getIsActive()): ?>
            
<td width="<?php echo $cellwidth ?>%" style="margin-bottom: 30px; text-align: center;">
                
<?php
                    $cur_category
=Mage::getModel('catalog/category')->load($_sub_category->getId());
                    
$layer Mage::getSingleton('catalog/layer');
                    
$layer->setCurrentCategory($cur_category);                    ?>                

                                    
<a href="<?php echo $this->getCurrentCategory()->getUrl()?>">
                                    
<?php if($_imageUrl=$this->getCurrentCategory()->getImageUrl()):?>
                                        
<img src="<?php echo $_imageUrl?>alt="<?php echo $this->getCurrentCategory()->getName();?>" height="80" title="<?php echo $this->getCurrentCategory()->getName();?>">
                                    
<?php else:?>
                                        
<img src="<?php echo $this->getSkinUrl('images/add-01.gif')?>" alt="<?php echo $this->getCurrentCategory()->getName();?>">
                                    
<?php endif;?>
                                    
</a>
                        <
div class="a-center" style="margin-top: 5px; text-align:center;">
                            <
a href="<?php echo $this->getCurrentCategory()->getUrl()?>"><?php echo $this->getCurrentCategory()->getName();?></a>
                          <
br/>
                        </
div>
            </
td>
            
<?php endif; ?>
        <?php
        
// Do we need to close the current row now?
        
if ($iCol == $categories_per_row// If the number of products per row has been reached
            
echo "</tr>\n";
            
$iCol 1;
        
}
        
else {
            $iCol
++;
        
}
        
endforeach;
        
// Do we need a final closing row tag?
        
if (sizeof$_main_categories ) < $categories_per_row{
            
echo "</tr>\n";
        
}    
        
endif;
    endforeach;
endif;
?>
</table>
<
br/>
<
br/>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top