Skip to content

How to add a custom field on checkout address form in Magento 2

How to add a custom field on checkout address form in Magento 2. we need to add some extra fields to show in checkout customer address form.
Please follow the simple steps to add a custom field on Checkout address form.

You can download the module from the below GitHub repository: 
How to add a custom field on checkout in Magento 2

Step 1: Create a plugin for the \Magento\Checkout\Block\Checkout\LayoutProcessor::process method.
first we have to make an entry in di.xml on this path
app/code/Dev/Testing/etc/frontend/di.xml

Step 2: Create a plugin class on this Directory.
app\code\Dev\Testing\Plugin\Checkout\Block\Checkout

After these two steps, your custom field will be displayed at the checkout address form. If in-case it does not display then check then try to flush Magento cache and refresh the page again and check. If you want to flush cache using CLI the refer our another post which Magento 2 useful commands lists.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Share via
Copy link
Powered by Social Snap