Magento – Get Dropdown Value from Custom Customer Attribute – Magento 2

custom-attributesmagento2

I want to get the value of a custom dropdown attribute however its proving more difficult that i anticipated. I have tried:

return $this->_customerSession->getCustomer()->getCp_permissions(); 
return $this->_customerSession->getCustomer()->getCp_permissions()->getValue();
return $this->_customerSession->getCustomer()->getCp_permissions()->getLabel();

No luck any ideas?

Best Answer

Ok typical i solved this instantly after posting:

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

This will pull the label not the ID of the attributes value.