I want to display all the products from the individual categories. I am putting my code here that what i have done so far.
I want to display product images only but it is giving me error like -
Fatal error: Call to a member function getItems() on a non-object in C:\xampp\htdocs \xampp\Kaushal\ r4power\app\des ign\frontend\de fault\r4power\t emplate\catalog \navigation\sli der_horizontal_ nav.phtml on line 11.
Code:
<?php
$_main_categories = $this->getStoreCategories();
foreach ($_main_categories as $_main_category):
?>
<li>
<div style="width:593px;">
<?php
$_products = $_main_category->getProductCollection();
$i=0;
foreach ($_products->getItems() as $_product):
if($i<3)
{
?>
<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(80) ?>" />
<?php
}
$i++;
endforeach
?>
</div>
<div class="lof-main-item-desc">
<h3><?php echo $_main_category->getName(); ?></h3>
<p>The one thing about a Web site, it always changes! Joomla! makes it easy to add Articles, content,...</p>
</div>
</li>
<?php
endforeach
?>
Fatal error: Call to a member function getItems() on a non-object in C:\xampp\htdocs \xampp\Kaushal\ r4power\app\des ign\frontend\de fault\r4power\t emplate\catalog \navigation\sli der_horizontal_ nav.phtml on line 11.