File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
app/code/Magento/Checkout/view/frontend/web/js/model/cart Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -53,16 +53,26 @@ define([
53
53
// save rates to cache after load
54
54
shippingService . getShippingRates ( ) . subscribe ( function ( rates ) {
55
55
cartCache . set ( 'rates' , rates ) ;
56
+ setShippingAddress ( ) ;
56
57
} ) ;
57
58
58
59
// update totals based on updated shipping address / rates changes
59
- if ( customerData . get ( 'cart' ) ( ) [ 'data_id' ] &&
60
+ if ( cartCache . get ( 'shipping-address' ) && cartCache . get ( 'shipping-address' ) . countryId &&
61
+ cartCache . isChanged ( 'shipping-address' , quote . shippingAddress ( ) ) &&
60
62
( ! quote . shippingMethod ( ) || ! quote . shippingMethod ( ) [ 'method_code' ] ) ) {
61
63
totalsDefaultProvider . estimateTotals ( quote . shippingAddress ( ) ) ;
62
64
}
63
65
}
64
66
} ,
65
67
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
+
66
76
/**
67
77
* Estimate totals for shipping address.
68
78
*/
You can’t perform that action at this time.
0 commit comments