Tag

magento2 attribute creation

Browsing

For some unique customization, we need to create category attributes to fulfil client requirements. Magento introduce data patch to create attributes after version Magento 2.3. So, We need to create category attribute using data patch in magento2. This Blog for Magento version >= 2.4.4 && PHP >= 8.1Here I created simple category attribute with datatype textCreate file: app/code/MageDad/Module/Setup/Patch/Data/AddCodeCategoryAttribute.php We need to run magento setup upgrade command to run this data patch.php bin/magento setup:upgradeCreate file – app/code/MageDad/Module/view/adminhtml/ui_component/category_form.xml…

In this blog, I created customer address attribute programmatic in magento 2. Code is supported to php8 and magento 2.4.6 😍Let’s see how to create customer address attribute programmatically. We are creating customer address attribute name unique_id.First, Create data patch class like AddUniqueIdAddressAttribute.php file at path app/code/Vendor/Module/Setup/Patch/Data/AddUniqueIdAddressAttribute.php After create patch run magento setup upgrade command for execute code.php bin/magento setup:upgradeWe can see newly created customer address attribute in customer edit/add. I hope this blog is useful for…

In this blog, I created customer attribute programmatically in magento 2. Code is supported to php8 and magento 2.4.6  😍Let’s see, how to create customer attribute programmatically. We are creating customer attribute name external_id.First, Create data patch class like AddExternalIdCustomerAttribute.php file at path app/code/Vendor/Module/Setup/Patch/Data/AddExternalIdCustomerAttribute.php After create patch run magento setup upgrade command to create customer attribute.php bin/magento setup:upgradeWe can see newly created customer attribute in customer edit/add. I hope this blog is useful for create customer…