Skip Navigation

[Resolved] Range filter for yacht lenght

This thread is resolved. Here is a description of the problem and solution.

Problem: I have a custom field that holds a numeric value for length. I would like to create a front-end search filter for that length field with several options for a range of lengths, like "12 - 24", "24 - 35", "35 - 50", "50+".

Solution: There is no simple stepped-range filter like this in Types and Views. The simplest way to set this up in Toolset is to create a separate custom radio field with the options shown in your filter. You must manage the value of this field independently of the length field, so there will be some duplication of data, but the View filter will work correctly on the front-end of the site.

With a bit of custom code, you could automate this field value based on the length value. See another ticket with a similar request: https://toolset.com/fr/forums/topic/pricing-view-filter-in-parametric-search/

This support ticket is created 4 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Easyweb Consulting 4 years, 9 months ago.

Assisted by: Christian Cox.

Author
Posts
#1547043
2020-03-11 15_01_34-Window.png

Hello.
I have an important project and I stoped with this problem.
I created a custom field "lenght" and I need to have a range filter by step (example in Image1.jpg)
In my case I will use a select box
Roberto

#1547485

Hello, unfortunately there is no simple stepped-range filter like this in Types and Views. The simplest way to set this up in Toolset is to create a separate custom radio field with the options shown in your filter. You must manage the value of this field independently of the length field, so there will be some duplication of data, but the View filter will work correctly on the front-end of the site.

With a bit of custom code, you could automate this field value based on the length value. I assisted on another ticket with a similar problem: https://toolset.com/fr/forums/topic/pricing-view-filter-in-parametric-search/

Do you think something like this would work for your site?

#1547885

Ok I will try based on your answer. Thank you so much