PHP Magento Tips

How to get details of currently added shopping cart items in Magento ?

Rate this posting:
{[['']]}

Simply add below code you will get details of currently added shopping cart items:

$cart = Mage::getModel('checkout/cart')->getItems();



echo "<pre>";

print_r($cart->getData());

echo "</pre>";
 
Or with Cart/Quote:
$cartquote = Mage::getModel('checkout/cart')->getQuote();

foreach ($cartquote->getAllItems() as $item) {
    $productName = $item->getProduct()->getName();
    $productPrice = $item->getProduct()->getPrice();
}

echo $productName;
echo $productPrice; 
You will get product name and price.
Tag : Magento
0 Comments On "How to get details of currently added shopping cart items in Magento ?"

Back To Top