1

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?

1

You can try this.

 $attributeLabel = $customer->getResource()
                 ->getAttribute('attribute_name')
                 ->getFrontend()
                 ->getAttribute()
                 ->getFrontendLabel();
  • You are welcome. You can use short version. It should be work also. $customer->getResource() ->getAttribute('attribute_name') ->getFrontendLabel(); – Neklo.com May 3 '16 at 20:58
  • how to get its value what we filled for particular customer ? – supriya mishra Jun 16 '17 at 12:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.