Skip to content

Commit

Permalink
FFWEB-3253: Remove multiple redirect to search result page
Browse files Browse the repository at this point in the history
Don't redirect to search result page if search in executed already on result page
  • Loading branch information
Rayn93 authored Dec 10, 2024
1 parent ceed552 commit ceeadab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Changelog
## Unreleased
### Fix
- Don't redirect to search result page if search is executed already on result page

## [v6.0.1] - 2024.11.21
### Improve
- Add the ability to set a name for the CategoryPath field (category page)
Expand Down
14 changes: 8 additions & 6 deletions src/Resources/views/storefront/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@
return;
}
if (searchOptions?.requestOptions?.origin?.tagName === `FF-SEARCHBOX`) {
window.location.href = `/factfinder/result?query=${searchParams.query}`;
// Cancel the pipeline to avoid sending a search request to FactFinder before the redirect is complete.
return false;
}
{% if app.request.pathInfo !== "/factfinder/result" %}
if (searchOptions?.requestOptions?.origin?.tagName === `FF-SEARCHBOX`) {
window.location.href = `/factfinder/result?query=${searchParams.query}`;
// Cancel the pipeline to avoid sending a search request to FactFinder before the redirect is complete.
return false;
}
{% endif %}
});
{% if page.extensions.factfinder.searchImmediate and not page.extensions.factfinder.ssr %}
Expand Down

0 comments on commit ceeadab

Please sign in to comment.