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();

}
?>




7 comments:

  1. This post is very informative, I really liked this post and very well maintained. Thanks for this kind of posts, keep updating.
    BP Sheets In Haryana

    ReplyDelete
  2. Really liked this post, its so informative and pretty well maintained, Thanks for this post, really appreciated, and keep updating.
    natural beauty products

    ReplyDelete
  3. Quiet impressive post and pretty well maintained. Thanks for this kind of post. Keep updating.
    hoverboard online

    ReplyDelete
  4. Thanks for the post like this, really appreciated.
    coenzyme q10 tablets

    ReplyDelete
  5. Its very impressive post, thanks for it and keep updating,
    buy burma ruby gemstone online

    ReplyDelete