File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
app/code/Magento/Checkout/view/frontend/web/js Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ define([
12
12
$ . widget ( 'mage.shoppingCart' , {
13
13
/** @inheritdoc */
14
14
_create : function ( ) {
15
- var items , i ;
15
+ var items , i , reload ;
16
16
17
17
$ ( this . options . emptyCartButton ) . on ( 'click' , $ . proxy ( function ( ) {
18
18
$ ( this . options . emptyCartButton ) . attr ( 'name' , 'update_cart_action_temp' ) ;
@@ -36,6 +36,27 @@ define([
36
36
$ ( this . options . continueShoppingButton ) . on ( 'click' , $ . proxy ( function ( ) {
37
37
location . href = this . options . continueShoppingUrl ;
38
38
} , this ) ) ;
39
+
40
+ $ ( document ) . on ( 'ajax:removeFromCart' , $ . proxy ( function ( ) {
41
+ reload = true ;
42
+ $ ( 'div.block.block-minicart' ) . on ( 'dropdowndialogclose' , $ . proxy ( function ( ) {
43
+ if ( reload === true ) {
44
+ location . reload ( ) ;
45
+ reload = false ;
46
+ }
47
+ $ ( 'div.block.block-minicart' ) . off ( 'dropdowndialogclose' ) ;
48
+ } ) ) ;
49
+ } , this ) ) ;
50
+ $ ( document ) . on ( 'ajax:updateItemQty' , $ . proxy ( function ( ) {
51
+ reload = true ;
52
+ $ ( 'div.block.block-minicart' ) . on ( 'dropdowndialogclose' , $ . proxy ( function ( ) {
53
+ if ( reload === true ) {
54
+ location . reload ( ) ;
55
+ reload = false ;
56
+ }
57
+ $ ( 'div.block.block-minicart' ) . off ( 'dropdowndialogclose' ) ;
58
+ } ) ) ;
59
+ } , this ) ) ;
39
60
}
40
61
} ) ;
41
62
Original file line number Diff line number Diff line change @@ -213,6 +213,7 @@ define([
213
213
*/
214
214
_updateItemQtyAfter : function ( elem ) {
215
215
this . _hideItemButton ( elem ) ;
216
+ $ ( document ) . trigger ( 'ajax:updateItemQty' ) ;
216
217
} ,
217
218
218
219
/**
You can’t perform that action at this time.
0 commit comments