Get products id, name, price, quantity, etc. present in your cart in Magento
<?php
$items = Mage::getSingleton(‘checkout/session’)->getQuote()->getAllItems();
foreach($items as $item) {
echo ‘ID: ‘.$item->getProductId().'<br />’;
echo ‘Name: ‘.$item->getName().'<br />’;
echo ‘Sku: ‘.$item->getSku().'<br />’;
echo ‘Quantity: ‘.$item->getQty().'<br />’;
echo ‘Price: ‘.$item->getPrice().'<br />’;
echo “<br />”;
}
?>