Skip to content

Commit f2f8474

Browse files
Merge pull request #35 from mageplaza/2.4-develop
2.4 develop
2 parents 1acfe2a + 8486d1e commit f2f8474

File tree

2 files changed

+245
-240
lines changed

2 files changed

+245
-240
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,13 @@ define(
4848
loader.startLoader();
4949

5050
/** fix load page FPC */
51-
const url = new URL(window.location);
52-
url.href = submitUrl;
53-
if(url.searchParams.get('mpLayer')){
54-
url.searchParams.delete('mpLayer');
55-
window.history.pushState({}, '', url);
51+
let urlTmp = new URL(submitUrl);
52+
if(urlTmp.searchParams.get('mpLayer')){
53+
urlTmp.searchParams.delete('mpLayer');
5654
}
5755
/** change browser url */
5856
if (typeof window.history.pushState === 'function' && (typeof isChangeUrl === 'undefined')) {
59-
window.history.pushState({url: submitUrl}, '', url.href);
57+
window.history.pushState({url: submitUrl}, '', urlTmp);
6058
}
6159

6260
if (method === 'post') {// For 'add to wishlist' & 'add to compare' event
@@ -70,7 +68,7 @@ define(
7068
});
7169
}
7270

73-
return $.get({url:submitUrl,cache:true},{'mpLayer': 1}).done(
71+
return $.get({url:submitUrl, cache:true}, {'mpLayer': 1}).done(
7472
function (response) {
7573
if (response.backUrl) {
7674
window.location = response.backUrl;

0 commit comments

Comments
 (0)