@@ -209,24 +209,7 @@ public function getConfiguration()
209
209
'openInNewWindow ' => in_array (InstantSearchRedirectOptions::OPEN_IN_NEW_WINDOW , $ this ->instantSearchConfig ->getInstantRedirectOptions ())
210
210
]
211
211
],
212
- 'autocomplete ' => [
213
- 'enabled ' => $ config ->isAutoCompleteEnabled (),
214
- 'selector ' => $ config ->getAutocompleteSelector (),
215
- 'sections ' => $ config ->getAutocompleteSections (),
216
- 'nbOfProductsSuggestions ' => $ config ->getNumberOfProductsSuggestions (),
217
- 'nbOfCategoriesSuggestions ' => $ config ->getNumberOfCategoriesSuggestions (),
218
- 'nbOfQueriesSuggestions ' => $ config ->getNumberOfQueriesSuggestions (),
219
- 'isDebugEnabled ' => $ config ->isAutocompleteDebugEnabled (),
220
- 'isNavigatorEnabled ' => $ config ->isAutocompleteNavigatorEnabled (),
221
- 'debounceMilliseconds ' => $ config ->getAutocompleteDebounceMilliseconds (),
222
- 'minimumCharacters ' => $ config ->getAutocompleteMinimumCharacterLength (),
223
- 'redirects ' => [
224
- 'enabled ' => $ this ->autocompleteConfig ->isAutocompleteRedirectEnabled (),
225
- 'showSelectableRedirect ' => $ this ->autocompleteConfig ->getAutocompleteRedirectMode () !== AutocompleteRedirectMode::SUBMIT_ONLY ,
226
- 'showHitsWithRedirect ' => $ this ->autocompleteConfig ->getAutocompleteRedirectMode () !== AutocompleteRedirectMode::SELECTABLE_REDIRECT ,
227
- 'openInNewWindow ' => $ this ->autocompleteConfig ->isAutocompleteRedirectInNewWindowEnabled ()
228
- ]
229
- ],
212
+ 'autocomplete ' => $ this ->getAutocompleteConfiguration (),
230
213
'landingPage ' => [
231
214
'query ' => $ this ->getLandingPageQuery (),
232
215
'configuration ' => $ this ->getLandingPageConfiguration (),
@@ -400,6 +383,29 @@ public function getConfiguration()
400
383
return $ transport ->getData ();
401
384
}
402
385
386
+ protected function getAutocompleteConfiguration (): array
387
+ {
388
+ $ config = $ this ->autocompleteConfig ;
389
+ return [
390
+ 'enabled ' => $ config ->isEnabled (),
391
+ 'selector ' => $ config ->getDomSelector (),
392
+ 'sections ' => $ config ->getAdditionalSections (),
393
+ 'nbOfProductsSuggestions ' => $ config ->getNumberOfProductsSuggestions (),
394
+ 'nbOfCategoriesSuggestions ' => $ config ->getNumberOfCategoriesSuggestions (),
395
+ 'nbOfQueriesSuggestions ' => $ config ->getNumberOfQueriesSuggestions (),
396
+ 'isDebugEnabled ' => $ config ->isDebugEnabled (),
397
+ 'isNavigatorEnabled ' => $ config ->isKeyboardNavigationEnabled (),
398
+ 'debounceMilliseconds ' => $ config ->getDebounceMilliseconds (),
399
+ 'minimumCharacters ' => $ config ->getMinimumCharacterLength (),
400
+ 'redirects ' => [
401
+ 'enabled ' => $ config ->isRedirectEnabled (),
402
+ 'showSelectableRedirect ' => $ config ->getRedirectMode () !== AutocompleteRedirectMode::SUBMIT_ONLY ,
403
+ 'showHitsWithRedirect ' => $ config ->getRedirectMode () !== AutocompleteRedirectMode::SELECTABLE_REDIRECT ,
404
+ 'openInNewWindow ' => $ config ->isRedirectInNewWindowEnabled ()
405
+ ]
406
+ ];
407
+ }
408
+
403
409
protected function areCategoriesInFacets ($ facets )
404
410
{
405
411
return in_array ('categories ' , array_column ($ facets , 'attribute ' ));
0 commit comments