Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Number of expanded facets is always > 0 #1656

Closed
NORDCOMPCZ opened this issue Jan 7, 2020 · 2 comments · Fixed by #1657
Closed

Number of expanded facets is always > 0 #1656

NORDCOMPCZ opened this issue Jan 7, 2020 · 2 comments · Fixed by #1657
Assignees

Comments

@NORDCOMPCZ
Copy link
Contributor

NORDCOMPCZ commented Jan 7, 2020

Acoording to settings, there is a possibility to set number of facets that are initially opened. In case you want all of them kept closed (set 0 in administration), this setting is not respected.

Preconditions

Magento Version : 2.3.1

ElasticSuite Version : 2.8.0

Environment : doesn't matter

Third party modules :

Steps to reproduce

  1. Set number of initially opened facets to 0
  2. Clear caches

Expected result

  1. None of the present facets should be opened

Actual result

  1. At least one (the first) is opened
@NORDCOMPCZ
Copy link
Contributor Author

Possible fix:

in src/module-elasticsuite-catalog/Block/Navigation.php, L:119
replace
$activeFilters = range(0, min(count($displayedFilters), $expandedFacets) - 1);
with
$activeFilters = []; if ($expandedFacets > 0) { $activeFilters = range(0, min(count($displayedFilters), $expandedFacets) - 1); }

@romainruaud
Copy link
Collaborator

Hello @NORDCOMPCZ

can you provide a PR with your fix for this one ?

Regards

NORDCOMPCZ added a commit to NORDCOMPCZ/elasticsuite that referenced this issue Jan 8, 2020
NORDCOMPCZ added a commit to NORDCOMPCZ/elasticsuite that referenced this issue Jan 9, 2020
NORDCOMPCZ added a commit to NORDCOMPCZ/elasticsuite that referenced this issue Jan 11, 2020
rbayet pushed a commit that referenced this issue Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants