From 418896ea862c0de9785b9084014298d49ee24b6c Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Thu, 4 Jun 2020 17:18:17 -0300 Subject: [PATCH 1/3] Removed States from Puerto Rico and better address formatting --- i18n/states.php | 1 + includes/class-wc-countries.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/i18n/states.php b/i18n/states.php index 6324a790c83..357d02b7083 100644 --- a/i18n/states.php +++ b/i18n/states.php @@ -1062,6 +1062,7 @@ return array( 'SD' => __( 'Sindh', 'woocommerce' ), ), 'PL' => array(), + 'PR' => array(), 'PT' => array(), 'PY' => array( // Paraguay states. 'PY-ASU' => __( 'Asunción', 'woocommerce' ), diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index 405a0d26cc7..ea9ab9224e7 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -527,6 +527,7 @@ class WC_Countries { 'NZ' => "{name}\n{company}\n{address_1}\n{address_2}\n{city} {postcode}\n{country}", 'NO' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'PL' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", + 'PR' => "{company}\n{name}\n{address_1} {address_2}\n{city} {postcode}\n{country}", 'PT' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'SK' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'RS' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", @@ -1149,6 +1150,12 @@ class WC_Countries { 'required' => false, ), ), + 'PR' => array( + 'state' => array( + 'required' => false, + 'hidden' => true, + ), + ), 'PT' => array( 'state' => array( 'required' => false, From a240547fdaef2dd7ff1b3500061b7057689ccb84 Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 5 Jun 2020 10:14:52 -0300 Subject: [PATCH 2/3] Puerto Rico: Make city hidden and change state to Municipality --- i18n/states.php | 1 - includes/class-wc-countries.php | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/i18n/states.php b/i18n/states.php index 357d02b7083..6324a790c83 100644 --- a/i18n/states.php +++ b/i18n/states.php @@ -1062,7 +1062,6 @@ return array( 'SD' => __( 'Sindh', 'woocommerce' ), ), 'PL' => array(), - 'PR' => array(), 'PT' => array(), 'PY' => array( // Paraguay states. 'PY-ASU' => __( 'Asunción', 'woocommerce' ), diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index ea9ab9224e7..fe73badb21c 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -527,7 +527,7 @@ class WC_Countries { 'NZ' => "{name}\n{company}\n{address_1}\n{address_2}\n{city} {postcode}\n{country}", 'NO' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'PL' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", - 'PR' => "{company}\n{name}\n{address_1} {address_2}\n{city} {postcode}\n{country}", + 'PR' => "{company}\n{name}\n{address_1} {address_2}\n{state} {postcode}\n{country}", 'PT' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'SK' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'RS' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", @@ -1151,10 +1151,13 @@ class WC_Countries { ), ), 'PR' => array( - 'state' => array( + 'city' => array( 'required' => false, 'hidden' => true, ), + 'state' => array( + 'label' => __( 'Municipality', 'woocommerce' ), + ), ), 'PT' => array( 'state' => array( From 5dc84e6d0f3a341db1dfd441e22b71b5c4c39faf Mon Sep 17 00:00:00 2001 From: Claudio Sanches Date: Fri, 5 Jun 2020 14:46:03 -0300 Subject: [PATCH 3/3] Update includes/class-wc-countries.php Co-authored-by: jonathansadowski --- includes/class-wc-countries.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-countries.php b/includes/class-wc-countries.php index fe73badb21c..74160a1d325 100644 --- a/includes/class-wc-countries.php +++ b/includes/class-wc-countries.php @@ -527,7 +527,7 @@ class WC_Countries { 'NZ' => "{name}\n{company}\n{address_1}\n{address_2}\n{city} {postcode}\n{country}", 'NO' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'PL' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", - 'PR' => "{company}\n{name}\n{address_1} {address_2}\n{state} {postcode}\n{country}", + 'PR' => "{company}\n{name}\n{address_1} {address_2}\n{state} \n{country} {postcode}", 'PT' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'SK' => "{company}\n{name}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}", 'RS' => "{name}\n{company}\n{address_1}\n{address_2}\n{postcode} {city}\n{country}",