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.

  • You mean you want to get attribute type where it is Select, text etc...? – Chirag Patel May 9 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. – Emipro Technologies Pvt. Ltd. May 9 at 12:55
0

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, privacy policy and cookie policy

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