From 158a555f7daaf6888b346740a759f9673d41648b Mon Sep 17 00:00:00 2001 From: Olexii Korshenko <okorshenko@ebay.com> Date: Tue, 30 Jun 2015 13:47:47 +0300 Subject: [PATCH] MAGETWO-39289: Estimate Shipping and Tax is affects first checkout step(summary bock) --- .../view/frontend/web/js/model/step-navigator.js | 14 +------------- .../frontend/web/js/view/summary/abstract-total.js | 10 +--------- 2 files changed, 2 insertions(+), 22 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 d0e71d6ab85..0ce40c7999a 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 @@ -39,20 +39,10 @@ define( return activeIndex; }, - isAvailable: function(code) { - var flag = false; - this.stepCodes.forEach(function(element){ - if (element == code) { - flag = true; - } - }); - return flag; - }, - isProcessed: function(code) { var activeItemIndex = this.getActiveItemIndex(); var sortedItems = steps.sort(this.sortItems); - var requestedItemIndex = 0; + var requestedItemIndex = -1; sortedItems.forEach(function(element, index) { if (element.code == code) { requestedItemIndex = index; @@ -62,9 +52,7 @@ define( }, navigateTo: function(step) { - var activeItemIndex = this.getActiveItemIndex(); var sortedItems = steps.sort(this.sortItems); - var stepIndex = sortedItems.indexOf(step); if (!this.isProcessed(step.code)) { return; } 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 7dd30b89032..35a4b0071d7 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,25 +14,17 @@ 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 !this.isShippingAvailable() || stepNavigator.isProcessed('shipping'); + return stepNavigator.isProcessed('shipping'); } }); } -- GitLab