Conversation
| <script type="text/javascript"> | ||
| var monsieurbizSearchPlugin = { | ||
| instantEnabled: true, | ||
| instantEnabled: {{ setting('monsieurbiz.search', 'instant_search_enabled__monsieurbiz_product') ? 'true' : 'false' }}, |
There was a problem hiding this comment.
🎯 suggestion: This is OK if you only index products. If I also have taxons or other entities in ES, we need to check that instant search is disabled for all entities.
Perhaps you should create a twig function to loop through all documentable entities and check the configuration.
There was a problem hiding this comment.
We need to build a form dynamically with all documentable entities with a default value to true if the value is not set yet
There was a problem hiding this comment.
@maximehuran a form here? But this is not a form, we don't generate any input fields. I am confused why you suggest a form here.
| <script type="text/javascript"> | ||
| var monsieurbizSearchPlugin = { | ||
| instantEnabled: true, | ||
| instantEnabled: {{ setting('monsieurbiz.search', 'instant_search_enabled__monsieurbiz_product') ? 'true' : 'false' }}, |
There was a problem hiding this comment.
We need to build a form dynamically with all documentable entities with a default value to true if the value is not set yet
The option for enabling and disabling the instant search currently has no effect at all.
In the sciprts template an option instantEnabled is passed with the value true every time. Even if the value was dynamic, the js was not using the variable at all.
I replaced the static "true" with the value from the setting. And then checked it in the js before adding the listener for the instant search. So the instant search is now only enabled it the settings is set to true.