1

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.

Thanks.

2
  • You mean you want to get attribute type where it is Select, text etc...? 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. May 9, 2019 at 12:55

1 Answer 1

0

Try this

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

I hope this will help

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.