как найти таблицу значений поля выбора пользовательского атрибута клиента

magento.stackexchange https://magento.stackexchange.com//questions/73563

Вопрос

я устанавливаю расширение custom_attribute, в котором я создал имя поля типа "язык" с типом множественного выбора, также есть возможность добавить значения параметров поля выбора.

i add this field into the edit profile page, after 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)пользовательский атрибут множественного выбора клиента (язык)

enter image description here

2)таблица атрибутов eav

enter image description here

3)Таблица varchar сущности клиента

enter image description here

Это было полезно?

Решение

В eav_attribute table,

  • Все атрибуты

В eav_attribute_option стол,

  • Параметры атрибутов со ссылкой на ссылку attribute_id в eav_attribute table

В eav_attribute_option_value стол,

  • Значения параметров атрибута со ссылкой на option_id в eav_attribute_option стол,

В вашем customer_entity_varchar стол 15,14,13,12 относится к option_id в eav_attribute_option таблицу, и вы можете ссылаться на ярлыки для 15,14,13,12 в eav_attribute_option_value стол

Чтобы получить такие значения, как 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);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top