I am trying to get quantity of simple products in the cart but it only returns the configurable quantity.
How can I get product simple qty in cart?
I am using this:
$session = Mage::getSingleton('checkout/session');
$cart = Mage::helper('checkout/cart')->getCart()->getQuote();
foreach ($cart->getItemsCollection() as $item) {
if($item->getProduct()->getData('type_id') == 'simple'){
$theqty = $this->escapeHtml($item->getQty());
}
}
Best Answer
Here, this should do what you need, you don't need to access the product object, and it's only the price you'd need from the configurable product line in the quote.