Get Dropdown Value from a Custom Customer Address Attribute
-
14-04-2021 - |
Domanda
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?
Soluzione
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 ...
Altri suggerimenti
$address->getResource()->getAttribute('custom_attribute')->getFrontend()->getValue($address);
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a magento.stackexchange