File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
view/frontend/web/js/action Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ define(
3232 layerContainer = $ ( '.layered-filter-block-container' ) ,
3333 quickViewContainer = $ ( '#mpquickview-popup' ) ;
3434
35- return function ( submitUrl , isChangeUrl ) {
35+ return function ( submitUrl , isChangeUrl , method ) {
3636 /** save active state */
3737 var actives = [ ] ,
3838 data ;
@@ -50,6 +50,16 @@ define(
5050 if ( typeof window . history . pushState === 'function' && ( typeof isChangeUrl === 'undefined' ) ) {
5151 window . history . pushState ( { url : submitUrl } , '' , submitUrl ) ;
5252 }
53+ if ( method === 'post' ) { // For 'add to wishlist' & 'add to compare' event
54+ return storage . post ( submitUrl ) . done (
55+ ) . fail (
56+ function ( ) {
57+ window . location . reload ( ) ;
58+ }
59+ ) . always ( function ( ) {
60+ loader . stopLoader ( ) ;
61+ } ) ;
62+ }
5363
5464 return storage . get ( submitUrl ) . done (
5565 function ( response ) {
You can’t perform that action at this time.
0 commit comments