How to check user is logged in or not if logged in get his details:


<?php
$CusSession=mage::getSingleton('customer/session');
//Checking customer is logged in or not
if($CusSession->isLoggedIn())
{
$customer    = $CusSession->getCustomer();    //get Customer object
$CustomerName        = $customer->getName();
$customerEmail = $customer->getEmail();
$customerFirstname = $customer->getFirstname();
$customerLastname = $customer->getLastname();
echo $CustomerName;
}
else
{
echo "Customer is not logged in";
}
?>

Categories: Magento

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *