As of now community edition only have the option for creating product attribute from admin side. But for creating custom magento2 catalog , customer attribute is not available in admin side . So either we will use custom script or create a new module for creating custom magento2 attribute. Also I have given a link of sample module through which you can get custom module to create custom magento2 attribute for category, customer.

I have given three example for creating product, catalog and customer attribute . Then you can use it either by custom script or through your custom module to execute the query to create custom magento2 attribute. I have also provided another article that is in magento1 for creating different attribute( How to create attribute by custom script mageneto1 ) .For more details you can refer to magento1 article, but here I am giving another article for magento2 as magento2 structure has been changed .

Product Attribute:

Use entity: \Magento\Catalog\Model\Product::ENTITY

Category Attribute:

 

Customer Attribute:

for getting full files with custom module, you can download from here

custom magento2 attribute

Leave a Reply

Your email address will not be published. Required fields are marked *