I Have an object of Mage_Customer_Model_Customer and ran the following code:
$customer->loadByEmail($customer->getEmail());
$customer->getGender(); //returns the EAV attribute option_id's of 1 or 2
I am trying to get the eav_attribute_option_value.value of those option_id's which is the word "Male" or the word "Female"
I am not sure how to do this and spent quite a bit of time debugging the account form select widget with no success. I am also curious on how you figured this out.
Thanks in advance
Sincerly, Tired Dev
Place the below code at a place whereever you want to display the attribute label. $_product->getResource()->getAttribute('your_attribute_code')->getFrontend()->getValue($_product); Just replace your_attribute_code with whatever your attribute is named. Save this answer.
$attributeOptions = $customer->getSource()->getAllOptions(false);
echo "<pre>"; print_r($attributeOptions); echo "</pre>";
http://blog.chapagain.com.np/magento-how-to-get-attribute-name-and-value/
EDIT: From Link:
$entityType = Mage::getModel('eav/config')->getEntityType('invoice');
$entityTypeId = $entityType->getEntityTypeId();
$attribute = Mage::getResourceModel('eav/entity_attribute_collection')
->setCodeFilter('order_id')
->setEntityTypeFilter($entityTypeId)
->getFirstItem();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With