- This topic has 1 reply, 2 voices, and was last updated 4 years, 10 months ago by .
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Option to deactivate search filter
Tagged: V3
Hi!
Is there a way to let the customer activate/deactivate a search filter in the search form?
My problem:
I have custom fields for WooCommerce but all products does not fill in the fields. In Search & Replace I hav Post Meta field with Range Number input type. If I set the minimum value to 0 then it will display results from all products that don’t have any value at all. If I set the min value to 1 the it will never display any products that don’t have any value.
So my thought were to let the visitor activate and deactivate the field depending on if the visitor is looking for products with or without that specific field.
Ah. Range fields will tend to cause some issues like this. We intend to improve the way the range fields work for V3 (due in a few weeks), but for now they work as follows.
Once a range field is present on a form, and the filter is submitted by a user, the range field values will be added to the query parameters. If a post (in your case products) has no value for that field, it will be omitted from the results. The consequence of this is, if you use a field to populate a range slider, every post MUST have a value entered, even if it is 0. In V3 I think you will be given a choice of how to treat posts that have no value (always include or always exclude).
It is also possible that we will allow form fields to be ‘deactivated’ and thus not used, but I think the above mentioned when to include empty (NULL) field values might be a better choice.
This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
We also use cookies to store items in your cart as well as allowing your to login on the site.
You can adjust all of your cookie settings by navigating the tabs on the left hand side.
By continuing to use this site, you also agree to our Privacy Policy.
Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.
*Other cookies used for logging in and cart functions will only be used when you use those features and cannot be disabled.
If you disable these cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.
This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.
Keeping this cookie enabled helps us to improve our website.
Please enable Strictly Necessary Cookies first so that we can save your preferences!
More information about our Cookie Policy