In magento 2.3.1, I created custom eav_entity_type and attribute also assign under that custom eav_entity_type.

Now, I added attribute options programmatically in that attribute and that record I saved in eav_attribute_options and eav_attribute_options_value tables.

Now, I used this below code for get that all options. But, I return blank array.

 /*Get attribute details*/
    $attributeDetails = $this->eavConfig->getAttribute("custom_eav_entity_type", 'custom_eav_attr');
    print_r($attributeDetails->getData()); //return blanks

How do I get that all options?

Any help would be appriciated.


  • You mean you want to get attribute type where it is Select, text etc...? Commented May 9, 2019 at 11:44
  • No. I added attribute in custom eav_entity_type and my custom attribute save under custom eav_entity_type. For ex: color attribute save under catalog_product eav_entity_type. Commented May 9, 2019 at 12:55

1 Answer 1


Try this

$attribute = $this->eavConfig->getAttribute('eav_entity_type_code', 'attributecode');
$attributeoptions = $attribute->getSource()->getAllOptions();

I hope this will help


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.