Get all Configurable product only

Get all configrable product only. Firstly get product collection with attribute filter.
$total is counter taht is how many product show in last.


Here is full code......

$collectionConfigurable = Mage::getResourceModel('catalog/product_collection')->addAttributeToFilter('type_id', array('eq' => 'configurable'));

$total=0;
foreach ($collectionConfigurable as $_configurableproduct) {
echo $_configurableproduct->getSku() . "<br>";
$total++;
}
echo $total;

Labels: