From 9b9d451a821afad79feeb8def9d0b601041a5664 Mon Sep 17 00:00:00 2001 From: niravkrish Date: Thu, 18 Apr 2019 15:09:02 +0530 Subject: [PATCH 1/2] fixed - issue 21596 --- .../view/frontend/web/js/view/payment.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js b/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js index c17e5e40d5c98..ad6f39b7d6d5f 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js @@ -66,9 +66,21 @@ define([ navigate: function () { var self = this; - getPaymentInformation().done(function () { - self.isVisible(true); - }); + if(!self.hasShippingMethod()) { + this.isVisible(false); + stepNavigator.setHash('shipping'); + } else { + getPaymentInformation().done(function () { + self.isVisible(true); + }); + } + }, + + /** + * @return {Boolean} + */ + hasShippingMethod: function () { + return window.checkoutConfig.selectedShippingMethod !== null; }, /** From 6645cb21827b2162887b705e63026027343002d5 Mon Sep 17 00:00:00 2001 From: nmalevanec Date: Fri, 19 Apr 2019 15:16:10 +0300 Subject: [PATCH 2/2] Fix static test. --- app/code/Magento/Checkout/view/frontend/web/js/view/payment.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js b/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js index ad6f39b7d6d5f..e8994c61b7221 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/payment.js @@ -66,7 +66,7 @@ define([ navigate: function () { var self = this; - if(!self.hasShippingMethod()) { + if (!self.hasShippingMethod()) { this.isVisible(false); stepNavigator.setHash('shipping'); } else {