Skip to content

Commit

Permalink
Merge pull request #232 from EmicoEcommerce/fix-urlencode-filter
Browse files Browse the repository at this point in the history
Fix: urlencode filter
  • Loading branch information
ah-net authored Dec 17, 2024
2 parents 7e3179a + 28704d3 commit 37ae8a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Model/NavigationConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ public function getJsFormConfig()
'productListSelector' => '.products.wrapper',
'toolbarSelector' => '.toolbar.toolbar-products',
'ajaxCache' => true,
'urlStrategy' => $this->config->getUrlStrategy() ===
QueryParameterStrategy::class
? 'queryparameter'
: 'path',
],
];
if ($this->config->isPersonalMerchandisingActive()) {
Expand Down
10 changes: 7 additions & 3 deletions view/frontend/web/js/navigation-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ define([
noticeMessageSelector: '.message.notice',
isLoading: false,
ajaxCache: true,
urlStrategy: '',
},

currentXhr: null,
Expand Down Expand Up @@ -183,10 +184,13 @@ define([
href = seoHref ? seoHref : href;
}

let url = new URL(href, window.location.origin);
url.search = this._getFilterParameters();
if (this.options.urlStrategy === 'queryparameter') {
let url = new URL(href, window.location.origin);
url.search = this._getFilterParameters();
return url.toString();
}

return url.toString();
return href;
},

/**
Expand Down

0 comments on commit 37ae8a4

Please sign in to comment.