Magento 2 How to Create a Custom Customer Attribute for Data Patches?

 In Magento blog

You want to add custom referral code field in use customer account page. Then, you can create field for custom customer attribute.

Steps for Create a Customer Attribute for Data Patches Magento 2.

(1) <Vendorname>/<Modulename>/Setup/Patch/Data/AddCustomReferralCodeAttribute.php

(2) After use this commnad :

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f -j
php bin/magento indexer:reindex
php bin/magento cache:flush

[Note] : You can check admin panel in customer account information section and custom customer attribute in eav_attribute table that attribute creates successfully or not.

Leave a Comment