Q:

How to get correct quantity for child product in cart

I get cart items information using following code:
$cart_items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
foreach( $cart_items as $items )
{
        $items->getQty();
}

In above code $items->getQty() always return "float(1)" while more than 1 quantity add in cart for child product. 
How to get correct quantity for child product? 
Thanks in advance.

A:

Finally I found my solution:
$cart_items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
foreach( $cart_items as $items )
{
    STATIC $qty='';
    if($items->getProductType() == 'configurable')  //configurable products
    {
        $qty = $items->getQty();
        continue;
    }
    else                                            // non-configurable product
    {
        if (!$items->getParentItem())               // product which has not parent product 
        {
            $qty = $items->getQty();
        }
    }
    echo $qty;
}

