I have installed Magento CE 1.9 version and getting error after calling Catalog on Home page. Issue seems to be related with list.phtml.
ERROR : Fatal error: Call to a member function getSortedChildren() on a non-object in mageinc\app\design\frontend\rwd\default\template\catalog\product\list.phtml on line 74
I didn't change anything after installation and it seems this issue came with Magento 1.9 edition.
Issue is occurring for both List and Grid view on Catalog page as it is being called for both views.
Is there any best solution to resolve this issue ?
you just have to delete the method ->getSortedChildren();
at line 134
$_nameAfterChildren = $this->getChild('name.after')->getSortedChildren();
so you have
$_nameAfterChildren = $this->getChild('name.after');
Add these lines in your block section layouts file
<block type="core/text_list" name="product_list.name.after" as="name.after"/>
<block type="core/text_list" name="product_list.after" as="after"/>
Replace the code by:
<?php
$_nameAfter = $this->getChild('name.after');
// New if here
if($_nameAfter):
$_nameAfterChildren = $_nameAfter->getSortedChildren();
foreach($_nameAfterChildren as $_nameAfterChildName):
$_nameAfterChild = $this->getChild('name.after')->getChild($_nameAfterChildName);
$_nameAfterChild->setProduct($_product);
?>
<?php echo $_nameAfterChild->toHtml(); ?>
<?php endforeach; ?>
<?php endif; ?>
<?php
//set product collection on after blocks
$_afterChildren = $this->getChild('after');
if ($_afterChildren):
$_afterChildren = $this->getChild('after')->getSortedChildren();
foreach($_afterChildren as $_afterChildName):
$_afterChild = $this->getChild('after')->getChild($_afterChildName);
$_afterChild->setProductCollection($_productCollection);
?>
<?php echo $_afterChild->toHtml(); ?>
<?php endforeach; ?>
<?php endif; ?>
As seen in: https://magento.stackexchange.com/questions/20984/show-products-on-homepage-magento-1-9/20996#20996?newreg=c5c83466c28d45259ed36642cfe0a382
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With