Skip to content

Commit 7dc0fce

Browse files
committed
ACP2E-862: Cash on Delivery method is visible even if it is not allowed for that particular country
1 parent f81dfc1 commit 7dc0fce

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,17 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
1111
<test name="StorefrontCashOnDeliveryPaymentForSpecificCountryTest">
1212
<annotations>
13-
<title value="OnePageCheckout Cash on Delivery method is not visible, if it is not allowed for that specific Country."/>
14-
<description value="OnePageCheckout Cash on Delivery method is visible only for the allowed Countries, while disappears if the billing address selected from the not allowed Countries."/>
15-
<stories value="OnePageCheckout Cash on Delivery method disappears, if the address changed to the Country which is not allowed for it."/>
13+
<title value="OnePageCheckout cash on delivery method available only for the allowed specific Countries."/>
14+
<description value="OnePageCheckout cash on delivery method is visible only for the allowed Countries, while disappears if the billing address changed to not allowed Countries."/>
15+
<stories value="OnePageCheckout cash on delivery method disappears, if the address changed to the Country which is not allowed for it."/>
1616
<features value="OnePageCheckout"/>
1717
<severity value="AVERAGE"/>
1818
<testCaseId value="AC-3216"/>
1919
<useCaseId value="ACP2E-862"/>
2020
<group value="checkout"/>
2121
</annotations>
2222
<before>
23+
<magentoCLI command="config:set {{DisplayBillingAddressOnPaymentMethod.path}} {{DisplayBillingAddressOnPaymentMethod.value}}" stepKey="displayBillingAddressOnPaymentMethod"/>
2324
<!--Enable Cash On Delivery payment method-->
2425
<magentoCLI command="config:set {{CashOnDeliveryEnableConfigData.path}} {{CashOnDeliveryEnableConfigData.value}}" stepKey="enableCashOnDelivery"/>
2526
<!--Allow Cash On Delivery for Specific Country-->
@@ -60,7 +61,6 @@
6061

6162
<!-- Select Shipping Method-->
6263
<actionGroup ref="StorefrontSetShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
63-
6464
<!--Click next button to open payment section-->
6565
<actionGroup ref="StorefrontGuestCheckoutProceedToPaymentStepActionGroup" stepKey="clickNext"/>
6666

@@ -84,5 +84,9 @@
8484

8585
<!--Assert COD payment method not available anymore-->
8686
<dontSeeElement selector="input#cashondelivery" stepKey="dontSeeCodPaymentMethod"/>
87+
88+
<!-- Place order -->
89+
<actionGroup ref="ClickPlaceOrderActionGroup" stepKey="PlaceOrder" />
8790
</test>
8891
</tests>
92+

app/code/Magento/Checkout/view/frontend/web/js/view/billing-address.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,6 @@ function (
237237
* @return {*}
238238
*/
239239
getCountryName: function (countryId) {
240-
if (lastSelectedBillingAddress && String(lastSelectedBillingAddress['countryId']) !== String(countryId)) {
241-
this.updateAddresses();
242-
}
243-
lastSelectedBillingAddress = quote.billingAddress();
244-
245240
return countryData()[countryId] != undefined ? countryData()[countryId].name : ''; //eslint-disable-line
246241
},
247242

0 commit comments

Comments
 (0)