Menu Close
    Start a Project 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.



    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again