Created
July 5, 2017 11:35
-
-
Save edrdesigner/c015d61a05e230a76ad3e4d1e7d6fe80 to your computer and use it in GitHub Desktop.
Get Logged In Customer’s Magento 1.9 details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); // ID | |
$customer->getEntityId(); // ID | |
$customer->getEntityTypeId(); // ID | |
$customer->getAttributeSetId(); // ID | |
$customer->getEmail(); | |
$customer->getGroupId(); // ID | |
$customer->getStoreId(); // ID | |
$customer->getCreatedAt(); // yyyy-mm-ddThh:mm:ss+01:00 | |
$customer->getUpdatedAt(); // yyyy-mm-dd hh:mm:ss | |
$customer->getIsActive(); // 1 | |
$customer->getDisableAutoGroupChange(); | |
$customer->getTaxvat(); | |
$customer->getPasswordHash(); | |
$customer->getCreatedIn(); // Admin | |
$customer->getGender(); // ID | |
$customer->getDefaultBilling(); // ID | |
$customer->getDefaultShipping(); // ID | |
$customer->getDob(); // yyyy-mm-dd hh:mm:ss | |
$customer->getTaxClassId(); // ID | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment