Are there any plugin method for customer Data Provider to modify the address on the checkout page.

I am trying to override the address section, to be rendered on checkout for the customer.

I came to know it is loading from the Data Provider of model file of module customer.

I need help with how to use a plugin method for it? Can it be overridden?, I need to add more to address for the address object. Can this be done?

Please help me.


Yes, there are a number of extensions (plugins) available to help you add to the address on the checkout page. Depending on your specific need and preference, one of the extensions below might be suitable. I am sure the first one will be perfect for you:

  1. M2 Address Fields Manager
  2. One Step Checkout for Magento 2
  3. Magento 2 Order Attributes
  • can we do programmatically, i am asking custom plugin method Oct 5 '18 at 9:25
  • How the address of customer is rendered in checkout? Oct 5 '18 at 9:38

When you want to edit data of js in checkout page you must to know how it works.

First It will call an Object that Magento\Checkout\Model\CompositeConfigProvider to get all config and stored to window.checkoutConfig

with customer data, you will have Model \Magento\Checkout\Model\DefaultConfigProvider

because the function getCustomerData is private function that mean you must plugin after of the getConfig function vendor/magento/module-checkout/Model/DefaultConfigProvider.php:251

See: vendor/magento/module-checkout/Model/DefaultConfigProvider.php:251

Update 1:

If you don't know how to use you must learn about developing with Magento

1: How to create Magento 2 Module.

2: How to load Database table to Collection.

3: How to use the Plugin

4: after all come back here and follow my answer.

  • How can i get the customer address object there? I need all the customer address in the php file. Then i write custom code there Oct 5 '18 at 9:36
  • Use \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer to get current login customer and get all Address
    – Hieu Le
    Oct 5 '18 at 9:38
  • I think you are not clear about my question, which section is responsible for customer address rendering, there i need to add custom logic, which is that file? and how to override it? Oct 5 '18 at 9:39
  • Did you want to edit customer address in Onepage checkout ? ??
    – Hieu Le
    Oct 5 '18 at 9:44
  • Updated answer.
    – Hieu Le
    Oct 5 '18 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.