Skip to content

Commit 2f25dce

Browse files
committed
Merge remote-tracking branch 'origin/MC-38048' into 2.4-develop-pr43
2 parents 093ae0f + b4ee601 commit 2f25dce

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

app/code/Magento/Checkout/Test/Mftf/Test/CheckoutDifferentDefaultCountryPerStoreTest.xml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
</after>
4040
<!-- Open product and add product to cart-->
4141
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage">
42-
<argument name="productUrlKey" value="$$createProduct.custom_attributes[url_key]$$"/>
42+
<argument name="productUrlKey" value="$createProduct.custom_attributes[url_key]$"/>
4343
</actionGroup>
4444
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
45-
<argument name="product" value="$$createProduct$$"/>
45+
<argument name="product" value="$createProduct$"/>
4646
<argument name="productCount" value="1"/>
4747
</actionGroup>
4848
<!-- Go to cart -->
@@ -59,5 +59,17 @@
5959
<actualResult type="const">$grabCountry</actualResult>
6060
<expectedResult type="string">{{DE_Address_Berlin_Not_Default_Address.country_id}}</expectedResult>
6161
</assertEquals>
62+
<!-- Go to cart -->
63+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="returnToCartPage"/>
64+
<!-- Switch to default store view -->
65+
<actionGroup ref="StorefrontSwitchDefaultStoreViewActionGroup" stepKey="switchToDefaultStoreView"/>
66+
<!-- Go to checkout page -->
67+
<actionGroup ref="OpenStoreFrontCheckoutShippingPageActionGroup" stepKey="proceedToCheckoutWithDefaultStore"/>
68+
<!-- Grab country code from checkout page and assert value with default country for default store view -->
69+
<grabValueFrom selector="{{CheckoutShippingSection.country}}" stepKey="grabDefaultStoreCountry"/>
70+
<assertEquals stepKey="assertDefaultCountryValue">
71+
<actualResult type="const">$grabDefaultStoreCountry</actualResult>
72+
<expectedResult type="string">{{US_Address_TX.country_id}}</expectedResult>
73+
</assertEquals>
6274
</test>
6375
</tests>

app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ define([
121121
);
122122
}
123123
checkoutProvider.on('shippingAddress', function (shippingAddrsData) {
124-
checkoutData.setShippingAddressFromData(shippingAddrsData);
124+
if (shippingAddrsData.street && !_.isEmpty(shippingAddrsData.street[0])) {
125+
checkoutData.setShippingAddressFromData(shippingAddrsData);
126+
}
125127
});
126128
shippingRatesValidator.initFields(fieldsetName);
127129
});

0 commit comments

Comments
 (0)