In this blog, we are going through how to add custom category attributes in Magento 2.

Why Create a Custom Category Attribute in Magento 2? Because in a category you need to add some external text, numbers, multiple choice categories, etc. you can create category attribute

In this blog, we create category attributes using the latest technology  “data/patch”.let’s start with how to create categories attribute.

⇒    First of all, you create “CategoryAttribute.php”  in this directory “Vendor_name/Module_name/Setup/Patch/Data/”.

⇒ After that you need to create “category_form.xml” in this directory “vendor_name/module_name/view/adminhtml/ui_component“.

⇒ and last you need to run this command in the root directory

  • php -dmemory_limit=2G bin/magento setup:upgrade
  • php -dmemory_limit=2G bin/magento setup:static-content:deploy -f -j
  • php -dmemory_limit=2G bin/magento cache:flush

⇒ after checking the custom category created successfully.  If you have any questions regarding this blog let me know in the comment section.

Thank You !!!!

One response to “MAGENTO 2 HOW TO CREATE CUSTOM CATEGORY ATTRIBUTE”

  1. Buy Best Proxy Avatar

    Hey there! I’ve been reading your weblog for some time now and finally got the bravery to go ahead and give you a shout out from Dallas Texas! Just wanted to say keep up the great work!

CynoInfotech

CynoInfotech was founded in 2019, in Ahmedabad, Gujrat. we have a trusted Web Development and Design Company that helps businesses in streamlining their operations through Magento 2 Extension and advanced modern technology solutions.

Let’s connect