Create Customer attribute in Magento programmatically.

Customer attribute use to filter customer based on value.

Create InstallData.php file at app/code/{Vendor}/{Module Name}/Setup/InstallData.php

We this works for fresh module. If you need to add to already existed module, you need to use UpdateData.php instead of InstallData.php

In UpgradeData and UpgradeSchema need to add conditions of version of module.

Module version need to define at etc/module.xml

Let’s check that out too.

If like efforts, Please share, comment and subscribe for future posts and inspire more.

Leave a Reply