Menu Close
    Hire us Request quote Reading list Switch to dark mode

    How to create custom customer address attribute in Magento 2

    Magento provides some default fields to store the customer address information. But, sometimes, we need to add additional information in customer address. In this case, we can create a custom address field to store the additional information. So, in this blog, we will learn how to create a custom customer address attribute.

    Firstly, create the file Vendor\Module\Setup\InstallData.php


    InstallData conforms to InstallDataInterface, which requires the implementation of the install method that accepts two parameters of type ModuleDataSetupInterface and ModuleContextInterface.

    Using the addAttribute method on the instance of Magento\Eav\Setup\EavSetupFactory, we are instructing Magento to add a number of attributes.

     

     

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just received your message and our expert will get back to you shortly.
    Send Again
    Close