Get Customer Custom attribute value in Magento 2.

We can get custom attribute value of Customer in magento 2 by simple way. If we have created any customer attribute in Magento 2 and we need to get that value in any place in code you can just get custom attribute value by below way,

Let’s we consider Mobile attribute value is custom attribute value created for Customer, attribute code for Mobile is mobile.

You can get customer custom_attribute value by,

return will be your customer custom_attribute mobile value.

Leave a Reply

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