Get All Items & Totals In Magento Shopping Cart

Wednesday, October 31, 2012
This blog will show you how to get all items in a shopping cart and totals in a magento store :
 $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();
 foreach($items as $item) {
    echo 'Product ID: '.$item->getProductId();
    echo 'Product Name: '.$item->getName();
    echo 'Product Sku: '.$item->getSku();
    echo 'Product Quantity: '.$item->getQty();
    echo 'Product Price: '.$item->getPrice();

Price Currency Conversion in Magento

This article is to show you how to convert price amount from one currency of the shop to another currency.
// Currency conversion rates have to be available in the target currency
$fromCur = ‘USD’; // currency code to convert from – usually your base currency
$toCur = ‘EUR’; // currency to convert to
$price = Mage::helper(‘directory’)->
currencyConvert(1000, $fromCur, $toCur);
// if you want it rounded:
$converted_final_price = Mage::app()->getStore()->roundPrice($price);

How to show Category List in Magento

You can show all categories present in magento.
There are different methods to get the category list. Below are some possible methods:-
Get all categories
The following code will fetch all categories (both active and inactive) that are present in your Magento Shop.
$categories = Mage::getModel('catalog/category')
->getCollection()
->addAttributeToSelect('*');

Get all active categories: