In Magento Checkout page i want to get the Cart Details Like
Product name, Price, Quantity, product Image.
Using Session . . I dont know how to get the session Details.. Kindly Help Me out here. .
In Magento Checkout page i want to get the Cart Details Like
Product name, Price, Quantity, product Image.
Using Session . . I dont know how to get the session Details.. Kindly Help Me out here. .
You can get your order from checkout session .Then using order id you can get orders item details by load of sales models.
$session=Mage::getSingleton('checkout/type_onepage')->getCheckout();
$session->getLastSuccessQuoteId();
$orderId= $session->getLastOrderId();
// If checkout onepage singleton not work then use checkout session
if(is_null($orderId)){
$orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
}
if ($orderId) {
$order = Mage::getModel('sales/order')->load($orderId);
if ($order->getId()) {
$items =$order->getAllVisibleItems();
foreach ($items as $item)
{
$item->getName(); // product name
$item->getPrice();
$item->getSku();
$item->getProductId();
$item->getQtyOrdered();
// load product model for gettting images
$product=Mage::getModel('catalog/product')->load($item->getProductId());
if($product->getId()):
echo $product->getSmallImageUrl();
endif;
}
}
}