0

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?

asked Nov 30, 2017 at 14:28

1 Answer 1

1

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.

answered Nov 30, 2017 at 14:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.