How to get customer data by customer id in magento 2?

You can get customer information by just passing customer id using below code snippet, Create Block file,

Call getCustomer($id) function in template file,

Get all customer data by below way,

echo “<pre>”;print_r($customer->__toArray());

 

 

One Reply to “How to get customer data by customer id in magento 2?”

Leave a Reply

Your email address will not be published. Required fields are marked *