0

I want to filter the shipping address visible on the Magento2 checkout page based on a custom address attribute. I want to show only those address which has the required custom attribute value in them.

From which Magento2 class/file this comes on the checkout page? where I can add my logic. enter image description here

1

Possible look into the class

\Magento\Checkout\Model\DefaultConfigProvider::getConfig()

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Checkout/Model/DefaultConfigProvider.php#L291

\Magento\Checkout\Model\DefaultConfigProvider::getCustomerData()

https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Checkout/Model/DefaultConfigProvider.php#L377

The key customerData contains addresses where all the addresses could be loaded into checkout here. Plugin into \Magento\Checkout\Model\DefaultConfigProvider::getConfig() And change the result of key addresses for your purpose

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.