How to get logged in customer's details in Magento
If you want to get logged in customer's details 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();
$customer->getPrefix();
$customer->getName(); // Full Name
$customer->getFirstname(); // First Name
$customer->getMiddlename(); // Middle Name
$customer->getLastname(); // Last Name
$customer->getSuffix();
// All other customer data
$customer->getWebsiteId();
$customer->getEntityId();
$customer->getEntityTypeId();
$customer->getAttributeSetId();
$customer->getEmail();
$customer->getGroupId();
$customer->getStoreId();
$customer->getCreatedAt();
$customer->getUpdatedAt();
$customer->getIsActive();
$customer->getDisableAutoGroupChange();
$customer->getTaxvat();
$customer->getPasswordHash();
$customer->getCreatedIn();
$customer->getGender();
$customer->getDefaultBilling();
$customer->getDefaultShipping();
$customer->getDob();
$customer->getTaxClassId();
}
?>
Very informative post about the magento programming. Thanks for it and keep updating.
ReplyDeleteGalvanised Sheets In Delhi
Its a vital information about the logged in customers details and this post is just awesome. Thanks for posting this kind of posts and keep updating.
ReplyDeleterejuvenating skin products
Such a nice post and really impressive with the information which is really helpful. Thanks for sharing and keep updating.
ReplyDeletehoverboard stores in delhi
Really nice.
ReplyDeletecoenzyme q10 supplement
thanks for it, keep updating.
ReplyDeletebuy basra pearl online
Really amazing post, thanks for it.
ReplyDeleteSelf Balancing Hoverboard Price
Lymphoma Cancer doctor In noida
ReplyDeleteLymphoma Cancer Consultant In noida
Esophageal Cancer doctor In noida