Add category attribute Programmatically in Magento 2.

We can create custom category attribute programmatically in Magento 2 using simple module. In our demo we have created a simple text field attribute for a category.

You can see a category attribute in the backend using Catalog -> Categories Page.
Click on Any category and you can see our custom attribute in General Section after the category name.

Continue reading “Add category attribute Programmatically in Magento 2.”

Magento 2 – How to get all options of specific attribute type?

In Magento 2 we can get all options of specific EAV entity types attribute. In Magento 2 There are many native EAV Entity Types are available.

You can get all options of specific attribute, Let’s we take a catalog_product Entity Type.
We take Color attribute from Catalog_Product Eav Entity Types. Fetch all the options of color attribute.
Create Block file,

Call Function From Template file,

The result looks like,