From 5a736409eef6c7841f4a6fc8f3a7a8a8affd2a32 Mon Sep 17 00:00:00 2001 From: "Leandro F. L" Date: Thu, 28 Feb 2019 16:20:05 +0100 Subject: [PATCH 1/2] Fix: Cart is emptied when enter is pressed after changing product quantity --- .../Magento/Checkout/view/frontend/web/js/shopping-cart.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js index 399321bd2f67d..b09a003613970 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js @@ -14,7 +14,11 @@ define([ _create: function () { var items, i; - $(this.options.emptyCartButton).on('click', $.proxy(function () { + $(this.options.emptyCartButton).on('click', $.proxy(function (event) { + if (event.detail == 0) { + return; + } + $(this.options.emptyCartButton).attr('name', 'update_cart_action_temp'); $(this.options.updateCartActionContainer) .attr('name', 'update_cart_action').attr('value', 'empty_cart'); From 5d0245df8119614ad52768f7d1b1bbfd35c4c626 Mon Sep 17 00:00:00 2001 From: Pavel Bystritsky Date: Thu, 4 Apr 2019 15:56:02 +0300 Subject: [PATCH 2/2] magento/magento2#21512: Static test fix. --- app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js b/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js index b09a003613970..8935242724f3e 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/shopping-cart.js @@ -15,7 +15,7 @@ define([ var items, i; $(this.options.emptyCartButton).on('click', $.proxy(function (event) { - if (event.detail == 0) { + if (event.detail === 0) { return; }