Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move country to top of form for all countries #47375

Merged
merged 3 commits into from
May 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -38,6 +41,10 @@
.wc-block-components-country-input,
.wc-block-components-checkbox {
flex: 0 0 100%;

&:first-child {
margin-top: 0;
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/47375-add-move-country-to-first
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: update

Move country to be the first field in Checkout block.
22 changes: 11 additions & 11 deletions plugins/woocommerce/src/Blocks/Domain/Services/CheckoutFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ public function __construct( AssetDataRegistry $asset_data_registry ) {
'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' => __(
Expand Down Expand Up @@ -164,17 +175,6 @@ public function __construct( AssetDataRegistry $asset_data_registry ) {
'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' => __(
Expand Down