Get products data in cart

Tweet, share & co

tweet fb share g+ share

Tags


Description

Display products data in cart

Code

$items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();

foreach($items as $item) {
        echo 'ID: '.$item->getProductId().'
'; echo 'Name: '.$item->getName().'
'; echo 'Sku: '.$item->getSku().'
'; echo 'Quantity: '.$item->getQty().'
'; echo 'Price: '.$item->getPrice().'
'; echo "
"; }