Header Ad

Friday, April 2, 2010

Retriving Cart Items in Magento

$mageFilename = 'app/Mage.php';
require_once $mageFilename;

umask(0);
Mage::app();

Mage::getSingleton('core/session', array('name'=>'frontend'));

$session = Mage::getSingleton('checkout/session');

$output = "";

foreach ($session->getQuote()->getAllItems() as $item) {

$output .= $item->getSku() . "
";
$output .= $item->getName() . "
";
$output .= $item->getDescription() . "
";
$output .= $item->getQty() . "
";
$output .= $item->getBaseCalculationPrice() . "
";
$output .= "
";
}

print $output;

No comments: