1

I installed the custom_attribute extension, in that I created a field name like "language" with multi select type, also there is a option to add the select box option values.

I added this field into the edit profile page, after the user selects the user language I want to display the selected language to some other page.

May i know in which table the options value will be stored?

See the below screen you will be feel better to answer my post.

1)customer custom multi select attribute(language)

enter image description here

2)eav attribute table

enter image description here

3)Customer entity varchar table

enter image description here

1 Answer 1

3

In eav_attribute table,

  • All attributes

In eav_attribute_option table,

  • Attributes options with reference to reference attribute_id in eav_attribute table

In eav_attribute_option_value table,

  • Attribute option values with reference to option_id in eav_attribute_option table,

In your customer_entity_varchar table 15,14,13,12 refers to option_id in eav_attribute_option table and you can refer the labels for 15,14,13,12 in eav_attribute_option_value table

To get the values like array(12=>'Portuguese',13=>'spanish',14=>'hindi',15=>'tamil')

 /**
     * @var $config  Mage_Eav_Model_Config
     * @var $options Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection
     */
    $storeId   = Mage::app()->getStore()->getId();
    $config    = Mage::getModel('eav/config');
    $attribute = $config->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'color');
    $values    = $attribute->setStoreId($storeId)->getSource()->getAllOptions();
    print_r($values);

    //here is another method
    $options = Mage::getResourceModel('eav/entity_attribute_option_collection');
    $values  = $options->setAttributeFilter($attribute->getId())->setStoreFilter($storeId)->toOptionArray();
    print_r($values);
4
  • i got it your answer,but i want this like array(12=>'Portuguese',13=>'spanish',14=>'hindi',15=>'tamil'), how can i achieve this
    – senthil
    Commented Jul 8, 2015 at 6:09
  • I have updated the answer Commented Jul 8, 2015 at 6:23
  • How to use this for customer/address? @saravanavelu I try change Mage_Catalog_Model_Product for Mage_Customer_Model_Address, but don't work, you can help me? Commented Nov 14, 2017 at 16:27
  • @saravanavelu See this magento.stackexchange.com/questions/201483/… Commented Nov 14, 2017 at 16:33

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.