In this post I am going to explain how to add customer attribute programmatically in magento 2. First we need to create the setup file InstallData.php File path: app/code/Ht/Mymodule/Setup/InstallData.php <?php namespace Ht\Mymodule\Setup; use Magento\Eav\Model\Config; use Magento\Eav\Setup\EavSetup; use Magento\Eav\Setup\EavSetupFactory; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; class InstallData implements InstallDataInterface { private $eavSetupFactory; public function __construct( EavSetupFactory…


Recent Comments