I need to get the account details of a registered customer and use them in the invoice PDF. The customer belongs to customer group "testgroup". By using the order details I can get the customer group and check if the customer belongs to "testgroup".

How do I get the customer ID and the rest of the account details?

2 Answers 2


Given $order, I can get the email from the order like this:

$customer_email = $order->getCustomerEmail();

Then I can get the account details with the following code:

$customer = Mage::getModel("customer/customer"); 
echo $customer->getId(); 
echo $customer->getFirstName(); 

Credit: http://www.techdilate.com/code/magento-get-customer-details-by-email-id/

$customer = Mage::getSingleton('customer/session')->getCustomer();
    $customerAddressId = Mage::getSingleton('customer/session')->getCustomer()->getDefaultBilling();
    $address = Mage::getModel('customer/address')->load($customerAddressId);
    $fullname = $customer->getName();
    $firstname = $customer->getFirstname();
    $lastname = $customer->getLastname();
    $email = $customer->getEmail();
    $taxvat = $customer->getTaxvat();
    $tele = $customer->getTelephone();
    $telephone = $address->getTelephone();
    $street = $address->getStreet();
    $City = $address->getCity();
    $region = $address->getRegion();
    $postcode = $address->getPostcode();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.