File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 55 "mageplaza/module-core" : " ^1.4.5"
66 },
77 "type" : " magento2-module" ,
8- "version" : " 4.0.3 " ,
8+ "version" : " 4.0.4 " ,
99 "license" : " proprietary" ,
1010 "authors" : [
1111 {
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 ) {
Original file line number Diff line number Diff line change @@ -214,15 +214,14 @@ define([
214214 var el = $ ( this ) ;
215215 $ ( el ) . bind ( 'click' , function ( e ) {
216216 var dataPost = $ ( el ) . data ( 'post' ) ,
217- formKey = $ ( 'input[name="form_key"]' ) . val ( ) ;
217+ formKey = $ ( 'input[name="form_key"]' ) . val ( ) , method = 'post' ;
218218 if ( formKey ) {
219219 dataPost . data . form_key = formKey ;
220220 }
221221
222222 var paramData = $ . param ( dataPost . data ) ,
223223 url = dataPost . action + ( paramData . length ? '?' + paramData : '' ) ;
224-
225- submitFilterAction ( url , true ) ;
224+ submitFilterAction ( url , true , method ) ;
226225 e . stopPropagation ( ) ;
227226 e . preventDefault ( ) ;
228227 } ) ;
You can’t perform that action at this time.
0 commit comments