Skip to content

Commit

Permalink
Correctly handle hash in URL for productlist caching (#2545)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Oct 31, 2024
1 parent 5aa2f9f commit f3ac4d5
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
(function() {
Isotope.displayBox('<?= $this->message ?>');

var url = window.location.href + (document.location.search ? '&' : '?') + '&buildCache=1',
xhr = new XMLHttpRequest();
var url = new URL(window.location.href);
url.searchParams.set('buildCache', '1');

xhr.open('GET', encodeURI(url));
var xhr = new XMLHttpRequest();
xhr.open('GET', encodeURI(url.toString());
xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');

xhr.onload = function() {
Expand All @@ -30,4 +31,4 @@
xhr.send();
})();
</script>
<?php $this->endblock(); ?>
<?php $this->endblock(); ?>

0 comments on commit f3ac4d5

Please # to comment.