Last active
July 8, 2024 08:47
-
-
Save assoscoupa/be76d5b61527890a4de0b5fde9002ecf to your computer and use it in GitHub Desktop.
Woocommerce Make Greece GR State/County Mandatory
This file contains hidden or 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
| /* By deafault State fields for Greece is not mandatory. | |
| If you want to change it to mandatory, add this code snippet into function.php. | |
| I found this solutions there: https://www.mootpoint.org/blog/woocommerce-make-uk-county-field-required/ */ | |
| add_filter( 'woocommerce_get_country_locale', 'mp_change_locale_field_defaults'); | |
| function mp_change_locale_field_defaults($countries) { | |
| $countries['GR']['state']['required'] = true; | |
| return $countries; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment