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?

0

1 Answer 1

1

You can try this.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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