Move country to top of form for all countries (#47375)

* Move country to top of form for all countries

* adjust styling

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Seghir Nadir 2024-05-13 16:24:40 +02:00 committed by GitHub
parent 2db29164f9
commit 76a9e2eb27
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 13 deletions

View File

@ -26,8 +26,11 @@
flex: 1 0 calc(50% - #{$gap-small}); // "flex-grow = 1" allows the input to grow to fill the space
box-sizing: border-box;
&:nth-of-type(2),
&:first-of-type {
&:first-child {
margin-top: 0;
}
&:first-child + .wc-block-components-text-input {
margin-top: 0;
}
}
@ -38,6 +41,10 @@
.wc-block-components-country-input,
.wc-block-components-checkbox {
flex: 0 0 100%;
&:first-child {
margin-top: 0;
}
}
}
}

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Move country to be the first field in Checkout block.

View File

@ -104,6 +104,17 @@ class CheckoutFields {
'autocapitalize' => 'none',
'index' => 0,
],
'country' => [
'label' => __( 'Country/Region', 'woocommerce' ),
'optionalLabel' => __(
'Country/Region (optional)',
'woocommerce'
),
'required' => true,
'hidden' => false,
'autocomplete' => 'country',
'index' => 1,
],
'first_name' => [
'label' => __( 'First name', 'woocommerce' ),
'optionalLabel' => __(
@ -164,17 +175,6 @@ class CheckoutFields {
'autocapitalize' => 'sentences',
'index' => 50,
],
'country' => [
'label' => __( 'Country/Region', 'woocommerce' ),
'optionalLabel' => __(
'Country/Region (optional)',
'woocommerce'
),
'required' => true,
'hidden' => false,
'autocomplete' => 'country',
'index' => 50,
],
'city' => [
'label' => __( 'City', 'woocommerce' ),
'optionalLabel' => __(