Magento 获取已登录用户的信息– Get Logged In Customer’s Full Name, First Name, Last Name and Email Address

Magento 获取已登录用户的信息– Get Logged In Customer’s Full Name, First Name, Last Name and Email Address

// 检查是否有客户登陆
if (Mage::getSingleton('customer/session')->isLoggedIn()) {

    // 加载客户数据
    $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();

    // 所有其他客户数据
    $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
}

发表评论

发表评论

*

沙发空缺中,还不快抢~