File tree Expand file tree Collapse file tree 3 files changed +13
-18
lines changed
Checkout/view/frontend/web/js
Customer/view/frontend/web/js Expand file tree Collapse file tree 3 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -14,20 +14,17 @@ define([
14
14
'use strict' ;
15
15
16
16
var quoteItems = ko . observable ( quote . totals ( ) . items ) ,
17
- cartData = customerData . get ( 'cart' ) ;
17
+ cartData = customerData . get ( 'cart' ) ,
18
+ quoteSubtotal = parseFloat ( quote . totals ( ) . subtotal ) ,
19
+ subtotalAmount = parseFloat ( cartData ( ) . subtotalAmount ) ;
18
20
19
21
quote . totals . subscribe ( function ( newValue ) {
20
22
quoteItems ( newValue . items ) ;
21
23
} ) ;
22
24
23
- cartData . subscribe ( function ( ) {
24
- var quoteSubtotal = parseFloat ( quote . totals ( ) . subtotal ) ,
25
- subtotalAmount = parseFloat ( cartData ( ) . subtotalAmount ) ;
26
-
27
- if ( quoteSubtotal !== subtotalAmount ) {
28
- customerData . reload ( [ 'cart' ] , false ) ;
29
- }
30
- } , this ) ;
25
+ if ( quoteSubtotal !== subtotalAmount ) {
26
+ customerData . reload ( [ 'cart' ] , false ) ;
27
+ }
31
28
32
29
return {
33
30
totals : quote . totals ,
Original file line number Diff line number Diff line change @@ -94,17 +94,17 @@ define([
94
94
this . isLoading ( addToCartCalls > 0 ) ;
95
95
sidebarInitialized = false ;
96
96
this . update ( updatedCart ) ;
97
-
98
- if ( cartData ( ) [ 'website_id' ] !== window . checkout . websiteId ) {
99
- customerData . reload ( [ 'cart' ] , false ) ;
100
- }
101
97
initSidebar ( ) ;
102
98
} , this ) ;
103
99
$ ( '[data-block="minicart"]' ) . on ( 'contentLoading' , function ( ) {
104
100
addToCartCalls ++ ;
105
101
self . isLoading ( true ) ;
106
102
} ) ;
107
103
104
+ if ( cartData ( ) [ 'website_id' ] !== window . checkout . websiteId ) {
105
+ customerData . reload ( [ 'cart' ] , false ) ;
106
+ }
107
+
108
108
return this . _super ( ) ;
109
109
} ,
110
110
isLoading : ko . observable ( false ) ,
Original file line number Diff line number Diff line change @@ -232,11 +232,9 @@ define([
232
232
if ( ! _ . isEmpty ( privateContent ) ) {
233
233
countryData = this . get ( 'directory-data' ) ;
234
234
235
- countryData . subscribe ( function ( ) {
236
- if ( _ . isEmpty ( countryData ( ) ) ) {
237
- customerData . reload ( [ 'directory-data' ] , false ) ;
238
- }
239
- } , this ) ;
235
+ if ( _ . isEmpty ( countryData ( ) ) ) {
236
+ customerData . reload ( [ 'directory-data' ] , false ) ;
237
+ }
240
238
}
241
239
} ,
242
240
You can’t perform that action at this time.
0 commit comments