In this post I am going to explain how to get customer data by customer id Magento 2. Using below code snippet you can get customer data by passing customer id. Add below code snippet in Block class. protected $_customerRepository; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository, array $data = [] ) { $this->_customerRepository =…


Recent Comments