Skip to content

Instantly share code, notes, and snippets.

@xlplugins
Last active September 12, 2022 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xlplugins/dfa7f0141918c1d45b3b24faddd2d248 to your computer and use it in GitHub Desktop.
Save xlplugins/dfa7f0141918c1d45b3b24faddd2d248 to your computer and use it in GitHub Desktop.
Germany Custom address for germany, netherland and belgium
add_action( 'wfacp_internal_css', function () {
?>
<script>
window.addEventListener('bwf_checkout_load', function () {
wfacp_frontend.hooks.addFilter('wfacp_country_address_google_format', function (country_format, format, code) {
console.log("code");
console.log(code);
if (code == 'de' ||code == 'be' || code == 'nl') {
country_format._address_1 = {'keys': {'route': 'long_name'}, 'separator': ' '};
country_format._address_2 = {
'keys': {'street_number': 'long_name'},
'separator': ' '
};
}
return country_format;
});
});
</script>
<?php
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment