In this tutorial, Today I will explain to how to update product attribute using data patches in Magento 2. From Magento 2.3.x, Magento brings new features which is data patches. The Data Patch is class that contains data notification instruction. Previously, Magento 2 uses InstallData and UpgradeData file use add data in core table or custom table. From Magento 2.3…
Tag: attributes
Magento 2 : Create a Category Attribute using Data Patches
In this tutorial, Today I will explain to how to create a category attribute using data patches in Magento 2. Magento added new features which is data patches after Magento 2.3.x. Previously, Magento 2 uses InstallData and UpgradeData file use add data in core table or custom table. From Magento 2.3 it will be replaced by Data Patch. How to…
Magento 2 : Create a Product Attribute using Data Patches
In this tutorial, Today I will explain to how to create a product attribute using data patches in Magento 2. From Magento 2.3.x, Magento brings new features which is data patches. The Data Patch is class that contains data notification instruction. Previously, Magento 2 uses InstallData and UpgradeData file use add data in core table or custom table. From Magento…
How to Create Product Attribute Programmatically in Magento 2
In this tutorial, Today I will explain to how to create product attribute programmatically in Magento 2. To create product attribute, we need to create InstallData.php file in your custom module. Magento 2 Product Structure follows EAV structure. So, we can not create new attribute from database table. When, you will setup your module at that time, InstallData file will…
How to Add Custom Customer Attribute in Magento 2
In this tutorial, Today I will explain you about how to add custom customer attribute in Magento 2. For that, You need to create InstallData.php file in your custom module. When you execute setup upgrade command for install module at that time, your custom customer attribute will be create by script. Custom Customer Attribute is useful when you want to…
How to Check if Attribute is Swatch Attribute in Magento 2?
In this tutorial, We will learn about how to check if the attribute is swatch attribute or not in Magento 2. There are many types of attribute we can create in Magento 2. For example, Dropdown, text, swatch, Multiple Select, Price, etc. Sometimes, We need to check attribute type by attribute code or attribute id. So, how can we check…