From eccff559a539b55c9b7d0f6a18d5ed5b056317c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9stor=20Soriano?= Date: Thu, 11 May 2023 11:05:11 +0200 Subject: [PATCH] Hide state selector from Ethiopia and Rwanda addresses (#35481) Co-authored-by: Ron Rennick --- .../changelog/hide_state_from_ethiopia_and_rwanda | 4 ++++ plugins/woocommerce/i18n/states.php | 2 ++ plugins/woocommerce/includes/class-wc-countries.php | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 plugins/woocommerce/changelog/hide_state_from_ethiopia_and_rwanda diff --git a/plugins/woocommerce/changelog/hide_state_from_ethiopia_and_rwanda b/plugins/woocommerce/changelog/hide_state_from_ethiopia_and_rwanda new file mode 100644 index 00000000000..30ba302229b --- /dev/null +++ b/plugins/woocommerce/changelog/hide_state_from_ethiopia_and_rwanda @@ -0,0 +1,4 @@ +Significance: patch +Type: fix + +Hide state selector for Ethiopia and Rwanda addresses diff --git a/plugins/woocommerce/i18n/states.php b/plugins/woocommerce/i18n/states.php index d2cf0663755..c8f0a66e54d 100644 --- a/plugins/woocommerce/i18n/states.php +++ b/plugins/woocommerce/i18n/states.php @@ -603,6 +603,7 @@ return array( 'ZA' => __( 'Zamora', 'woocommerce' ), 'Z' => __( 'Zaragoza', 'woocommerce' ), ), + 'ET' => array(), 'FI' => array(), 'FR' => array(), 'GF' => array(), @@ -1807,6 +1808,7 @@ return array( 'RSKM' => _x( 'Kosovo-Metohija', 'district', 'woocommerce' ), 'RSVO' => _x( 'Vojvodina', 'district', 'woocommerce' ), ), + 'RW' => array(), 'SE' => array(), 'UA' => array( // Ukrainian oblasts. https://github.com/unicode-org/cldr/blob/release-42/common/subdivisions/en.xml#L5243. 'UA05' => __( 'Vinnychchyna', 'woocommerce' ), diff --git a/plugins/woocommerce/includes/class-wc-countries.php b/plugins/woocommerce/includes/class-wc-countries.php index 7a880796eb2..5fac236ec1d 100644 --- a/plugins/woocommerce/includes/class-wc-countries.php +++ b/plugins/woocommerce/includes/class-wc-countries.php @@ -1024,6 +1024,12 @@ class WC_Countries { 'hidden' => true, ), ), + 'ET' => array( + 'state' => array( + 'required' => false, + 'hidden' => true, + ), + ), 'FI' => array( 'postcode' => array( 'priority' => 65, @@ -1393,6 +1399,12 @@ class WC_Countries { 'required' => false, ), ), + 'RW' => array( + 'state' => array( + 'required' => false, + 'hidden' => true, + ), + ), 'SG' => array( 'state' => array( 'required' => false,