After adding a custom customer attribute with a dropdown, having values ‘A (11)’ and ‘B (12)’, I attempted to display the attributes on the customer account page. However, upon adding the following code to the ‘info.phtml’ file, I received values instead of names.
getCustomer()->getCustomAttribute(‘customer_name’);
if ($customAttribute) {
echo $block->escapeHtml($customAttribute->getValue());
}
?>