0

I'm trying to get the frontend label of my custom address attribute and trying this:$address->getCustomAttribute("custom_attribute")->getValue(), gives me the value "95905" instead of the label.

How can I get the frontend label instead?

2 Answers 2

1

Try this two code may be help you :-

1)

$custom = $customer->getResource()->getAttribute('your_attribute')->getFrontend()->getValue($address);

2)

$customer = $this->_customerSession->getCustomer();
return $customer->getResource()->getAttribute('your_attribute')->getFrontend()->getValue($address);

Hope this help you

Thanks ...

3
  • Sadly they didnt work :( Commented Jun 1, 2020 at 15:18
  • showing any error ??? Commented Jun 1, 2020 at 19:52
  • 1
    try this $custom = $customer->getResource() ->getAttribute('attribute_name') ->getFrontend() ->getAttribute() ->getFrontendLabel(); Commented Jun 1, 2020 at 19:57
0

$address->getResource()->getAttribute('custom_attribute')->getFrontend()->getValue($address);

1

Your Answer

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

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