Skip Navigation

[Resolved] Price Range Option in filter

This support ticket is created 3 years, 6 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 3 voices.

Last updated by Waqar 3 years, 6 months ago.

Assisted by: Waqar.

Author
Posts
#2278447

Tell us what you are trying to do?
There is a custom field for the price which I would like to convert into a filter to use it as a filter in a price bar format.

Is there any documentation that you are following?
https://toolset.com/course-lesson/creating-a-custom-search/#dependent-parametric-search

Is there a similar example that we can see?
hidden link

What is the link to your site?
hidden link

#2278587

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Toolset doesn't offer a range filter, you would need to take the existing filter controls and convert them to a range filter using JavaScript.

A range filter implies a BETWEEN comparison, with filters for the FROM and TO values.

So insert a filter in your View for the custom field, using the BETWEEN comparison, and that will add the FROM and TO inputs.

If you study the resulting markup, it should be possible to modify the display to present it as a range slider (while still submitting the existing inputs, which you will hide).

#2279021

Hello Nigel,

Can you provide a code example or reference for this?
Or any plugin suggestion?

#2279717

Hi,

Thanks for writing back.

I'm afraid, we don't have a copy/paste code available for this, but, we do our best to guide you in the right direction, whenever possible.

In summary, there are two main steps:

1. First, you'll need to remove the search field "Valor de propiedad" and add it again, so that it uses the between operator, to accept the minimum and maximum values.

2. Once, the price range input fields are working, you can use some custom script to include a range slider and fill its selected values in those minimum and maximum price fields. You'll find examples of the code at:
hidden link

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar