I need to get the name of the Grouped Product in my Magento Cart. The problem is, what you add to the cart is the Simple Product, the Grouped Product only contains the images, title, and description. It's then associated to simple products (in most cases there are more than one) that contains some custom attributes. Another problem is that Simple Products can at times be associated with more than one Grouped Product. In this case I'd like to retrieve whichever one.
Here's what I have at the moment:
$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
foreach($items as $item) {
$product = Mage::getModel('catalog/product')->load($item->getProductId());
var_dump($item);
var_dump($product);
}
$product gives me the custom attributes I need to pull. $item gives me the quantity in the cart (which I need in this case)
The dump on $item retrieves this:
'parent_item_id' => null
Which is no good. I need it to have the id of the Grouped Product this Simple Product is associated to.
Any ideas?