i have add a customer attribute Salesman (select type, admin will asign salesman to customer at backend from list), any customer will have asigned a salesman who is responsible for contact with this customer.

Problem is, when i'm trying to access this attribute, i only get option_id number.

 $this->addColumn('salesman', array(
            'header'    => 'Salesman',
            'index'     => 'salesman'

returns number not a text value.

accessing this way:

$customerObj  = Mage::getModel('customer/entity_attribute ')->load($customer_id);
$attr = $customerObj->getAttributes('salesman');

returns the same number "option_id".

Is there any way to access value of this specific attribute? I would not preffer to change all select attributes to return value :)

Can anyone help me with it? All previous replies for similar questions, wasn't helpful.

  • have you created customer attribute Salesman with source model?
    – Abdul
    Commented Dec 18, 2015 at 10:25
  • can you share you source model?
    – Abdul
    Commented Dec 18, 2015 at 10:26

1 Answer 1



$attributeCode = 'salesman';

$customerObj  = Mage::getModel('customer/customer')->load($customer_id);

$textvalue = $customerObj->getResource()


$customerObj  = Mage::getModel('customer/customer')->load($customer_id);

$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'salesman');

$text = $attribute->getSource()->getOptionText($customerObj->getSalesman());
  • 2nd solution works :) Thak you very very much
    – grabusik
    Commented Dec 18, 2015 at 13:03

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.