Sauter la navigation

[Résolu] Range filter for yacht lenght

Ce fil est résolu. Voici une description du problème et la solution proposée.

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 Il y a 4 années et 10 mois. 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)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par Easyweb Consulting Il y a 4 années et 10 mois.

Assisté par: Christian Cox.

Auteur
Publications
#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