How to show Minimum price and Maximum price of this category product. In Below code i displayed category name, image and url. I want to show Minimum price and Maximum price of this category product
$layer = Mage::getSingleton('catalog/layer'); $category = Mage::getModel('catalog/category')->load($this->getCategoryId()); if ($category->getId()) { $origCategory = $layer->getCurrentCategory(); $layer->setCurrentCategory($category); } $collection = $layer->getProductCollection(); $collection->getSelect()->reset('order'); $collection->getSelect()->order('minimal_price','asc'); $collection->getSelect()->limit(1);
<div class="container">
<div class="row thmub_list">
<?php
$catIds = explode(',', $this->getIds());
$categories = array();
foreach ($catIds as $catId) {
$category = Mage::getModel('catalog/category')->load($catId);
$categories[$category->getName()] = array(
'url' => $category->getUrl(),
'img' => $category->getImageUrl()
);
}
ksort($categories, SORT_STRING);
?>
<?php if ($category->getIsActive()): ?>
<?php foreach ($categories as $name => $data): ?>
<div class="col-cxs-12 col-xs-12 col-xs-6 col-sm-6 col-md-4 col-lg-4 custom-item">
<div class="panel">
<a href="<?php echo $data['url']; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>">
<img id="cat-image" src="<?php echo $data['img']; ?>" class="img-responsive"/></a>
<h3 class="product-title"><a href="<?php echo $data['url']; ?>"><?php echo $name; ?></a></h3>
<button type="button" title="<?php echo $this->__('SELECT BOUQUETS') ?>" class="btn btn-default custom-btn" onclick="setLocation('<?php echo $data['url']; ?>')"><?php echo $this->__('SELECT BOUQUETS') ?></button>
<?php echo $collection->getFirstItem()->getMinimalPrice();?>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
I want to Show Min Price - Max Price in after category name