-1

I have displayed attribute filters in my catalog page. My client Requirement is, In some categories, attribute filter has no products that time i need to hide the empty attribute label. How can i achieve this Please help me.

"I need Product count for particular attribute that is shape,color and watts like that how can i get all products count by attribute, if i get count i will control the attribute label using that."

My code in catalog/layer/view.phtml:

    <?php if($this->canShowBlock()): ?>
    <?php // echo $this->getStateHtml() ?>
    <?php if($this->canShowOptions()): ?>
            <?php $_filters = $this->getFilters() ?>                
            <?php if($_filter->getItemsCount()):        
              <?php echo $this->__($_filter->getName()) ?>
                <?php echo $_filter->getCount();?>
                <?php  echo $_filter->getHtml(); ?>
            <?php endif;?>
              <?php endif;?>
            <?php endforeach; ?>
gopinadh
  • 11
  • 7

1 Answers1

0

//Get product collection from "catalog/product" model

$collection = Mage::getModel('catalog/product')->getCollection();

//Fetch Most popular Featured products

$collection->addAttributeToSelect('most_popular');
$collection->addAttributeToSelect('featured_prod');

//You can check your query by:

$collection->getSelect();

Hope this may help you.... :)

asishint
  • 109
  • 9