Skip to content

Commit 7005d99

Browse files
committed
Resolve "Clear Shopping Cart" button not working in Internet Explorer issue24491
1 parent e95cca3 commit 7005d99

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/code/Magento/Checkout/view/frontend/templates/cart/form.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<span><?= $block->escapeHtml(__('Continue Shopping')) ?></span>
5757
</a>
5858
<?php endif; ?>
59-
<button type="submit"
59+
<button type="button"
6060
name="update_cart_action"
6161
data-cart-empty=""
6262
value="empty_cart"

app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ define([
1515
var items, i, reload;
1616

1717
$(this.options.emptyCartButton).on('click', $.proxy(function (event) {
18-
if (event.detail === 0) {
19-
return;
20-
}
21-
2218
$(this.options.emptyCartButton).attr('name', 'update_cart_action_temp');
2319
$(this.options.updateCartActionContainer)
2420
.attr('name', 'update_cart_action').attr('value', 'empty_cart');
21+
if ($(this.options.emptyCartButton).parents('form').length > 0) {
22+
$(this.options.emptyCartButton).parents('form').submit();
23+
}
2524
}, this));
2625
items = $.find('[data-role="cart-item-qty"]');
2726

0 commit comments

Comments
 (0)