Showing posts with label display customer's details by customer's id in Magento. Show all posts
Showing posts with label display customer's details by customer's id in Magento. Show all posts

Friday, 5 February 2016

How to get logged in customer's details by customer's id in Magento

If you want to display customer's details by customer's id in Magento. 


You can use following code:


<?php


  // Check if any customer is logged in or not
if (Mage::getSingleton('customer/session')->isLoggedIn())
{

// Load the customer's data
$customer = Mage::getSingleton('customer/session')->getCustomer();

$id =$customer->getId(); // To get Customer Id


//Get Details Using Customer Id
$customer = Mage::getModel('customer/customer')->load($id)->getData();

                $customer->getName();                  

               $customer->getEmail();

}
?>