Skip to content

Commit 0cabe58

Browse files
committed
#13231: [GitHub] Default State or Province is not pre-selected in the Estimate Shipping and Tax
1 parent d865ef1 commit 0cabe58

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/new-customer-address.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ define([
2828
return {
2929
email: addressData.email,
3030
countryId: addressData['country_id'] || addressData.countryId || window.checkoutConfig.defaultCountryId,
31-
regionId: regionId || addressData.regionId,
31+
regionId: regionId || addressData.regionId || window.checkoutConfig.defaultRegionId,
3232
regionCode: addressData.region ? addressData.region['region_code'] : null,
3333
region: addressData.region ? addressData.region.region : null,
3434
customerId: addressData['customer_id'] || addressData.customerId,

dev/tests/js/jasmine/tests/app/code/Magento/Checkout/frontend/js/model/new-customer-address.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ define([
1414
beforeEach(function () {
1515

1616
window.checkoutConfig = {
17-
defaultCountryId: 'US'
17+
defaultCountryId: 'US',
18+
defaultRegionId: '12'
1819
};
1920

2021
newCustomerAddress = NewCustomerAddress;
@@ -27,6 +28,7 @@ define([
2728
it('Check on empty object.', function () {
2829
var expected = {
2930
countryId: 'US',
31+
regionId: 12,
3032
regionCode: null,
3133
region: null
3234
};

0 commit comments

Comments
 (0)