Skip to content

Commit

Permalink
Merge pull request #29 from mageplaza/2.4-develop
Browse files Browse the repository at this point in the history
2.4 develop
  • Loading branch information
chuccv authored Feb 9, 2022
2 parents 0fe7e44 + 753d109 commit dc66759
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "4.0.3",
"version": "4.0.4",
"license": "proprietary",
"authors": [
{
Expand Down
12 changes: 11 additions & 1 deletion view/frontend/web/js/action/submit-filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define(
layerContainer = $('.layered-filter-block-container'),
quickViewContainer = $('#mpquickview-popup');

return function (submitUrl, isChangeUrl) {
return function (submitUrl, isChangeUrl, method) {
/** save active state */
var actives = [],
data;
Expand All @@ -50,6 +50,16 @@ define(
if (typeof window.history.pushState === 'function' && (typeof isChangeUrl === 'undefined')) {
window.history.pushState({url: submitUrl}, '', submitUrl);
}
if (method === 'post') {// For 'add to wishlist' & 'add to compare' event
return storage.post(submitUrl).done(
).fail(
function () {
window.location.reload();
}
).always(function () {
loader.stopLoader();
});
}

return storage.get(submitUrl).done(
function (response) {
Expand Down
5 changes: 2 additions & 3 deletions view/frontend/web/js/view/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,14 @@ define([
var el = $(this);
$(el).bind('click', function (e) {
var dataPost = $(el).data('post'),
formKey = $('input[name="form_key"]').val();
formKey = $('input[name="form_key"]').val(), method = 'post';
if (formKey) {
dataPost.data.form_key = formKey;
}

var paramData = $.param(dataPost.data),
url = dataPost.action + (paramData.length ? '?' + paramData : '');

submitFilterAction(url, true);
submitFilterAction(url, true, method);
e.stopPropagation();
e.preventDefault();
});
Expand Down

0 comments on commit dc66759

Please sign in to comment.