How to Get Customer Custom Attribute Label – Magento 1.9

attributesmagento-1.9

I've created some custom attributes for customers. I can retrieve the values normally using $customer->getData('attribute'). But i also need the label for the respective attribute, the frontend label. I know there are a lot of answers out there, i did searched, but all of those answers is related with products, i want the customer custom attributes.

One of those answers i've tried so far: https://stackoverflow.com/a/12469321/4687714
but it return the value formated to frontend store, i want the attribute label.

So, how do i return the Label of a Customer custom attribute?

Best Answer

You can try this.

 $attributeLabel = $customer->getResource()
                 ->getAttribute('attribute_name')
                 ->getFrontend()
                 ->getAttribute()
                 ->getFrontendLabel();
Related Topic