'sales_executive' is my custom customer attribute. I'm using $collection->addAttributeToSelect('sales_executive'); This gives id of 'sales_executive' in the grid. How to obtain option label or value in place of id?


Try this updated code:

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

$attribute = $customer->getResource()->getAttribute('sales_executive');
if ($attribute)
    echo $attribute_value = $attribute ->getFrontend()->getValue($customer);
| improve this answer | |
  • Ya. This is the error. Fatal error: Call to a member function getResource() on a non-object – Kazim Noorani Dec 15 '16 at 13:35
  • Please find updated code above – Ram Pratap Singh Gour Dec 15 '16 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.