Fetch customer details using query or object manager
Want to display the following fields
First Name Last Name Email telephone State /region pincode
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this community$customerId = 3;
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerObj = $objectManager->create('Magento\Customer\Model\Customer')->load($customerId);
$customerAddress = array();
//Get all customer Data
var_dump($customerObj->getData());
foreach ($customerObj->getAddresses() as $address)
{
$customerAddress[] = $address->toArray();
}
//Here you will get Customer Address data like region, city etc.
foreach ($customerAddress as $customerAddres) {
echo $customerAddres['street'];
echo $customerAddres['city'];
}
Thanks