Skip to content

Commit dc66759

Browse files
authored
Merge pull request #29 from mageplaza/2.4-develop
2.4 develop
2 parents 0fe7e44 + 753d109 commit dc66759

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
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
{

view/frontend/web/js/action/submit-filter.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff 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) {

view/frontend/web/js/view/layer.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)