I have a small problem with product QTY, i have an ajax update cart extension and i need to display product qty, everything is ok until I add two products in cart. For example if I add first product in cart the quantity is perfect, but when I add the second product the quantity for all product is the last product quantity. I have the following code:
$cart_items = Mage::getSingleton('checkout/session')->getQuote()->getAllVisibleItems();
foreach($cart_items as $items) {
$qtyr = $items->getQty();
}
$htmlItem .=' <div class="qty-btngroup">
<input type="text" class="input-text qty" maxlength="12" title="Qty" size="4" value="'.$qtyr.'" name="" readonly="readonly">
</div>
$_response = Mage::getModel('ajaxminicart/response')
->setCartitem($html)
How can I solve this, I need the qty to be display for each product ..
Update: I paste here my entire public function: http://codepad.org/2ovDqy4i