Skip to content

Commit 3879db3

Browse files
committed
ACP2E-862: Cash on Delivery method is visible even if it is not allowed for that particular country
1 parent 2f2e37f commit 3879db3

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutPaymentSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<element name="productOptionsActiveByProductItemPrice" type="text" selector="//div[@class='subtotal']//span[@class='price'][contains(.,'{{price}}')]//ancestor::div[@class='product-item-details']//div[@class='product options active']" parameterized="true"/>
5353
<element name="productItemPriceByName" type="text" selector="//div[@class='product-item-details'][contains(., '{{ProductName}}')]//span[@class='price']" parameterized="true"/>
5454
<element name="tax" type="text" selector="[data-th='Tax'] span" timeout="30"/>
55-
<element name="taxPercentage" type="text" selector=".totals-tax-details .mark"/>
55+
<element name="taxPercentage" type="text" selector=".totals-tax-detailsStorefrontCashOnDeliveryPaymentForSpecificCountryTest.xml .mark"/>
5656
<element name="orderSummaryTotalIncluding" type="text" selector="//tr[@class='grand totals incl']//span[@class='price']" />
5757
<element name="orderSummaryTotalExcluding" type="text" selector="//tr[@class='grand totals excl']//span[@class='price']" />
5858
<element name="myShippingAndBillingAddressSame" type="input" selector=".billing-address-same-as-shipping-block"/>
@@ -65,6 +65,6 @@
6565
<element name="billingAddressSelectShared" type="select" selector=".checkout-billing-address select[name='billing_address_id']"/>
6666
<element name="discount" type="block" selector="tr.totals.discount"/>
6767
<element name="discountPrice" type="text" selector=".discount .price"/>
68-
<element name="billingAddressSameAsShippingCheckboxCod" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
68+
<element name="billingAddressSameAsShippingCashOnDeliveryCheckbox" type="checkbox" selector="#billing-address-same-as-shipping-cashondelivery"/>
6969
</section>
7070
</sections>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<click selector="{{StorefrontCheckoutPaymentMethodsSection.cashOnDelivery}}" stepKey="selectCashOnDeliveryMethod"/>
7878

7979
<!--Billing is same as shipping-->
80-
<checkOption selector="{{CheckoutPaymentSection.billingAddressSameAsShippingCheckboxCod}}" stepKey="selectPaymentSolution" />
80+
<checkOption selector="{{CheckoutPaymentSection.billingAddressSameAsShippingCashOnDeliveryCheckbox}}" stepKey="selectPaymentSolution" />
8181
<waitForPageLoad stepKey="waitForPageLoad"/>
8282

8383
<!--Assert COD payment method not available anymore-->

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,14 @@ function (
245245
*
246246
* @param {Boolean} force
247247
*/
248-
updateAddresses: function (force = false) {
249-
if (force || window.checkoutConfig.reloadOnBillingAddress ||
250-
!window.checkoutConfig.displayBillingOnPaymentMethod) {
248+
updateAddresses: function (force) {
249+
if (typeof force === "undefined"){
250+
force = false;
251+
}
252+
253+
if (force
254+
|| window.checkoutConfig.reloadOnBillingAddress
255+
|| !window.checkoutConfig.displayBillingOnPaymentMethod) {
251256
setBillingAddressAction(globalMessageList);
252257
}
253258
},

0 commit comments

Comments
 (0)