How to auto-fill customer address fields in shipping form at checkout page Magento2 ?

How to auto-fill customer address in shipping form at checkout page Magento2 – Today i am going to write some thing we commonly need in Magento 2 projects. Which is auto-fill customer address field where some fields already have values. Have values may be stored in cookies or session etc.

This is something little bit tricky and pretty simple task to achieve. You can achieve this with simple custom module using Plugin. I assume we already have a Custom Module here. Apart from creating a Custom Module we need to add 2 more extra steps.

  1. Creating di.xml file
  2. Creating the Plugin.

Creating di.xml file ( Ayakil/SetValue/etc/di.xml )

Creating the Plugin.

Path of the plugin is – app/code/Ayakil/SetValue/Plugin/Checkout/Model/Checkout/LayoutProcessor.php

That’s it. How to auto-fill customer address in shipping form at checkout page Magento2 is explained. Now you can see these default values in checkout page both guest and logged users first time.

You can views more article on GraphQl written by me.

That’s it. Have a nice day.Enjoy coding , Learn , Experience , Teach and Help.

1 thought on “How to auto-fill customer address fields in shipping form at checkout page Magento2 ?”

Leave a Reply

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