Skip to content

Commit 4a598e7

Browse files
committed
Checkout Page Cancel button is not working #21327
- hide cancel button if billing address is not available on current quote
1 parent d1ce6a4 commit 4a598e7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ function (
201201
this.isAddressDetailsVisible(true);
202202
}
203203
},
204+
/**
205+
* Manage cancel button visibility
206+
*/
207+
canUseCancelBillingAddress: ko.computed(function () {
208+
return quote.billingAddress() || lastSelectedBillingAddress;
209+
}),
204210

205211
/**
206212
* Restore billing address

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<button class="action action-update" type="button" data-bind="click: updateAddress">
2323
<span data-bind="i18n: 'Update'"></span>
2424
</button>
25-
<button class="action action-cancel" type="button" data-bind="click: cancelAddressEdit">
25+
<button class="action action-cancel" type="button" data-bind="click: cancelAddressEdit, visible: canUseCancelBillingAddress()">
2626
<span data-bind="i18n: 'Cancel'"></span>
2727
</button>
2828
</div>

0 commit comments

Comments
 (0)