Skip to content

Commit

Permalink
Fix bug multiple filters (#84)
Browse files Browse the repository at this point in the history
Fix bug in query parameter strategy
  • Loading branch information
ah-net authored Aug 22, 2023
1 parent c21add3 commit 18049fd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Model/Catalog/Layer/Url/Strategy/QueryParameterStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ public function getClearUrl(MagentoHttpRequest $request, array $activeFilterItem
*/
protected function getCurrentQueryUrl(MagentoHttpRequest $request, array $query)
{
$selectedFilters = $request->getQuery();
foreach ($selectedFilters as $filter => $value) {
if (!array_key_exists($filter, $query)) {
$query[$filter] = $value;
}
}

$params['_query'] = $query;
$params['_escape'] = false;

Expand Down Expand Up @@ -529,6 +536,8 @@ private function getCurrentUrl(MagentoHttpRequest $request) : string
return $this->url->getUrl('*/*/*', $params);
}

$url = ltrim($url, '/');

return str_replace($this->url->getBaseUrl(), '', $url);
}
}

0 comments on commit 18049fd

Please sign in to comment.