thanks for the above solution using patches. It's working and I used the same methodology using InstallData/UpgradeData.php according to my requirement.
Please check my answer
This will save the data in the database in table customer_entity_varchar and attributes in eav_attribute.
Check the code:
Magento 2 uses Data scripts to add attributes.
In folder Vendor/Module/Setup/Patch/Data add a .php file (eg: AddCustomerAttributes)
The following will add a few customer attributes.
After adding this bin/magento setup:upgrade command is required.
There will be an entry added to patch_list datatable, if the script file was executed correctly and also the attributes in the eav attribute table of course.
2
Answers
thanks for the above solution using patches. It's working and I used the same methodology using InstallData/UpgradeData.php according to my requirement.
Please check my answer This will save the data in the database in table customer_entity_varchar and attributes in eav_attribute. Check the code:
Magento 2 uses Data scripts to add attributes.
In folder Vendor/Module/Setup/Patch/Data add a .php file (eg: AddCustomerAttributes)
The following will add a few customer attributes.
After adding this bin/magento setup:upgrade command is required.
There will be an entry added to patch_list datatable, if the script file was executed correctly and also the attributes in the eav attribute table of course.
Please let me know if you need help with anything on this.