Skip to content

Commit 9815bd2

Browse files
committed
ACP2E-1143: trigger tax / subtotal estimates refresh on shipping address updates; jasmine unit test update
1 parent 9f9949b commit 9815bd2

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,27 @@
44
*/
55

66
define([
7+
'underscore',
78
'Magento_Checkout/js/model/quote',
89
'Magento_Checkout/js/model/shipping-rate-processor/new-address',
910
'Magento_Checkout/js/model/cart/totals-processor/default',
1011
'Magento_Checkout/js/model/shipping-service',
1112
'Magento_Checkout/js/model/cart/cache',
12-
'Magento_Customer/js/customer-data',
13-
'Magento_Checkout/js/checkout-data',
14-
'Magento_Checkout/js/action/select-shipping-method'
15-
], function (quote, defaultProcessor, totalsDefaultProvider, shippingService, cartCache, customerData, checkoutData, selectShippingMethodAction) {
13+
'Magento_Customer/js/customer-data'
14+
], function (_, quote, defaultProcessor, totalsDefaultProvider, shippingService, cartCache, customerData) {
1615
'use strict';
1716

1817
var rateProcessors = {},
1918
totalsProcessors = {},
2019

20+
/**
21+
* Cache shipping address until changed
22+
*/
23+
setShippingAddress = function () {
24+
var shippingAddress = _.pick(quote.shippingAddress(), cartCache.requiredFields);
25+
cartCache.set('shipping-address', shippingAddress);
26+
},
27+
2128
/**
2229
* Estimate totals for shipping address and update shipping rates.
2330
*/
@@ -65,14 +72,6 @@ define([
6572
}
6673
},
6774

68-
/**
69-
* Cache shipping address until changed
70-
*/
71-
setShippingAddress = function () {
72-
var shippingAddress = _.pick(quote.shippingAddress(), cartCache.requiredFields);
73-
cartCache.set('shipping-address', shippingAddress);
74-
},
75-
7675
/**
7776
* Estimate totals for shipping address.
7877
*/

0 commit comments

Comments
 (0)