Last active
September 12, 2022 12:40
-
-
Save xlplugins/dfa7f0141918c1d45b3b24faddd2d248 to your computer and use it in GitHub Desktop.
Germany Custom address for germany, netherland and belgium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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