Below I have a shipping address form of checkout page and I would like to add another field(P.O. Box) in this form. I tried to look it up every forums and most of the answers were based on overriding MagentoCheckoutBlockCheckoutLayoutProcessor
. I checked app/code/company/Checkout/etc/di.xml
but wasn’t referencing layoutprocessor
.
I am still confused from where this form is getting values from MagentoQuoteApiDataAddressInterface
or MagentoCheckoutviewfrontendlayoutcheckout_index_index.xml
how can I add custom field to this form? Can anyone give me any suggestions? It would be really helpful appreciate it
2
Answers
So after referring to lot of blogs I believe there are only 2 ways of creating custom field in which could be either by extending
MagentoCustomerApiDataAddressInterface
or by extendingMagentoCheckoutBlockCheckoutLayoutProcessor
with the plugin created inapp/code/vendor/Checkout/etc/di.xml
. Also I noticed that the only purpose ofMagentoCheckoutviewfrontendlayoutcheckout_index_index.xml
was to load the whole chunk in a single block rendering in one page as it could be used for adding validation.you should check
MagentoCustomerApiDataAddressInterface
to add a new field to the address.