Search code examples
magento-1.5

Magento Login model email id with retrieve gender value from collection


I am new to magento. How to load customer collection to retrieve gender value by passing login email id?

Thanks.

Praksah


Solution

  • Afaik, Magento does not have explicit email id's for customers, only email addresses.

    To retrieve the gender for a given email address you could use:

    $oCustomer = Mage::getModel('customer/customer')
        ->setWebsiteId(1)
        ->loadByEmail('[email protected]');
    
    var_dump($oCustomer->getGender());
    

    The setWebsiteId(1) part is only neccessary when running with website scope.