From 041c397d8670635ec968a908973b706b13947c58 Mon Sep 17 00:00:00 2001 From: Serhiy Shkolyarenko <sshkolyarenko@ebay.com> Date: Fri, 26 Jun 2015 13:04:11 +0300 Subject: [PATCH] MAGETWO-39289: Estimate Shipping and Tax is affects first checkout step(summary bock) fixed shipping availability determination --- .../view/frontend/web/js/model/step-navigator.js | 2 +- .../frontend/web/js/view/summary/abstract-total.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/model/step-navigator.js b/app/code/Magento/Checkout/view/frontend/web/js/model/step-navigator.js index 7d153f14122..d0e71d6ab85 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/model/step-navigator.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/model/step-navigator.js @@ -42,7 +42,7 @@ define( isAvailable: function(code) { var flag = false; this.stepCodes.forEach(function(element){ - if (element.code == code) { + if (element == code) { flag = true; } }); diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js index 2511013120e..7dd30b89032 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/summary/abstract-total.js @@ -14,17 +14,25 @@ define( function (Component, quote, priceUtils, totals, stepNavigator) { "use strict"; return Component.extend({ + shippingAvailableFlag: undefined, getFormattedPrice: function (price) { return priceUtils.formatPrice(price, quote.getPriceFormat()); }, getTotals: function() { return totals.totals(); }, + isShippingAvailable: function() { + if (undefined !== this.shippingAvailableFlag) { + return this.shippingAvailableFlag; + } + this.shippingAvailableFlag = stepNavigator.isAvailable('shipping'); + return this.shippingAvailableFlag; + }, isFullMode: function() { if (!this.getTotals()) { return false; } - return !stepNavigator.isAvailable('shipping') || stepNavigator.isProcessed('shipping'); + return !this.isShippingAvailable() || stepNavigator.isProcessed('shipping'); } }); } -- GitLab