-
Notifications
You must be signed in to change notification settings - Fork 38
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
Fix/instant enabled option #218
base: master
Are you sure you want to change the base?
Conversation
@@ -1,6 +1,6 @@ | |||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
@@ -1,6 +1,6 @@ | |||
<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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.