Magento: getting EAV attribute parameter value / selection

I have a Mage_Customer_Model_Customer object and the following code runs:

$customer->loadByEmail($customer->getEmail()); $customer->getGender(); //returns the EAV attribute option_id of 1 or 2 

I am trying to get the eav_attribute_option_value.value value of these option_id, which is the word "Male" or the word "Female"

I'm not sure how to do this, and spent a lot of time debugging the account form widget without any success. I am also interested in how you understood this.

Thanks in advance

Sincerly, Tired Dev

+6
source share
1 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(); 
+8
source

Source: https://habr.com/ru/post/892547/


All Articles