Friday 6 July 2012

particular category show product in magnto

Open your ftp editor and go to app => design => frontend => base => default => template => catalog => product and create new php file calledyourfilename.phtml”. (considering that you are using default theme {change theme name and path according to your current selected theme})
Put the following code in yourfilename.phtml

<?php
$_productCollection=$this->getLoadedProductCollection();
$_helper = $this->helper('catalog/output');
if ($_productCollection->count()):
$_iterator = 0;
 
foreach ($_productCollection as $_product): ?>
 
<div> <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(145); ?>" width="120" height="120" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /></a>
<p><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></p>
<p><span><?php echo $this->getPriceHtml($_product, true) ?></span></p>
<p><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><img src="images/more-info.gif" width="110" height="30" alt="More Info" /></a></p>
</div>
 
<?php endforeach; // end products loop ?>
<script type="text/javascript">decorateList('products-list', 'none-recursive')</script>
<?php endif; // if product collection ?>

Finally we will call this piece of code on our store’s home page. Go to Admin => CMS => Pages and edit your store’s selected home page.


 
{{block type="catalog/product_list" category_id="179" 
template="catalog/product/yourfilename.phtml"}}
 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.