show count of only configurable products of current category
Posted
by
hs19
on Stack Overflow
See other posts from Stack Overflow
or by hs19
Published on 2011-02-25T07:19:05Z
Indexed on
2011/02/25
7:24 UTC
Read the original article
Hit count: 193
hello, i want to show count of only configurable products of current category on category page. for that I have written following code...
<?php $cate = Mage::registry('current_category')->getName();
$total=0;
$category = Mage::registry('current_category');
$products = $category->getProductCollection();
foreach ( $products as $_product )
if ($_product->isConfigurable())
{
$total++;
}
echo $cate."(".$total.")"; ?>
my problem is the code is showing the total count of configurable products of all child categories... can anyone help me with this?
© Stack Overflow or respective owner