I’m working on a WordPress plugin for WooCommerce. I need to overwrite the shipping and billing address blocks in the checkout form, because addresses are different in my country.
I’ve searched the WooCommerce docs, searched stackoverflow, and asked LLMs. All I could find are either hooks that are never called or suggestions to do this with Javascript. The Javascript solutions are brittle because they rely on the id
and class
attributes of WooCommerce html never changing. It can also collide with other Javascript that manipulates the dom, now or in the future.
n.b. This may not be done from a theme for my use-case as I have no control over which themes the end user will install. Please do not suggest this.