2011-07-12 19 views
6

मैं Mage_Customer_Model_Customer का एक उद्देश्य है और निम्नलिखित कोड भाग गया:Magento: एक EAV गुण विकल्प के मूल्य हो रही है/चयन

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

मैं उन option_id के eav_attribute_option_value.value शब्द है जो प्राप्त करने के लिए कोशिश कर रहा हूँ "पुरुष" या शब्द "महिला"

मुझे यकीन नहीं है कि यह कैसे करें और खाता सफलता फॉर्म को बिना सफलता के डिबग करने में काफी समय बिताया। मैं इस बात पर भी उत्सुक हूं कि आपने इसे कैसे समझ लिया।

अग्रिम धन्यवाद

Sincerly, थक देव

उत्तर

8
$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/

संपादित करें: लिंक से:

$entityType = Mage::getModel('eav/config')->getEntityType('invoice'); 
$entityTypeId = $entityType->getEntityTypeId(); 

$attribute = Mage::getResourceModel('eav/entity_attribute_collection') 
       ->setCodeFilter('order_id') 
       ->setEntityTypeFilter($entityTypeId) 
       ->getFirstItem(); 
+1

मेरे द्वारा चुने गए विकल्प के लिए देख रहा था, इस लिंक प्रदान की बस कि। धन्यवाद! –