Web Analytics

Fill the form & Get Installation Support

    For example, when we create a mobile number customer attribute in Magento 2,  we need to create a module to add new customer attribute in Magento2.

    Create a registration.php file to the following path

    Create module.xml file to the following path  app/code/Magemonkeys/CustomerAttribute/etc/module.xml which define our module setup version to setup_module table.

    Then, we need to create an extension_attributes.xml file to the following path app/code/Magemonkeys/CustomerAttribute/etc/extension_attributes.xml

    which defines our mobile number customer attribute.

    Pass Classname in extension_attributes.xml as Magento\Customer\Api\Data\CustomerInterface because its a base Customer interface to create customer attributes in Magento2.

    Set attribute code as your customer attribute code and define type as a string.

    For Create Customer attribute we need to define InstallData.php file to the following path app/code/Magemonkeys/CustomerAttribute/Setup/InstallData.php which adds an entry to our database for custom mobile number attribute.

    Now Run the upgrade command to install our module using SSh from the root of your Magento instance.

    Now you can check your new mobile number attribute at the admin panel.

    Go To, Customers -> All Customers -> Edit any Customer.

    Fill the below form if you have any Magento programming need.

      Recent Articles

      Author Info

      Author Image

      Magento Certified Developer

      Hire J. Lakum

      Get a Free Quote

        Let our Magento expert connect to discuss your requirement.

          We offer Magento
          certified developers.

          Our Magento clientele
          is 500+.

          We sign NDA for the
          security of your projects.

          We’ve performed 100+
          Magento migration projects.

          Free quotation
          on your project.

          Three months warranty on
          code developed by us.