Forums › Forums › Search & Filter Pro › Filtering between Minimum and Maximum Values
Tagged: filter, Minimum and Maximum Values, post meta, range slider
- This topic has 33 replies, 3 voices, and was last updated 7 years, 10 months ago by Anonymous.
-
Anonymous(Private) December 23, 2016 at 9:33 am #78442
Hello,
I am using shortcode method to display the results.
I have 2 post meta fields (Min Loan Amount & Maximum Loan Amount) to filter using the slider.If i change the value in range slider to filter, results should display only the posts which has loan amount between Min Loan Amount & Max Loan Amount Field.
For Example :
1. Min Loan Amount is 1000 , Max Loan Amount is 100000
2. Min loan amount is 2000 , Max Loan Amount is 60000.
3. Min Loan Amount is 5000 , Max Loan Amount is 100000.In filter form, I set (Start Meta Key) Min Key Name as “Min Loan Amount” , Max key name as “Max Loan Amount” and Compare Mode as “Input must be within the Post Meta range”.
Value in the filer form should be between Post Meta fileds (Min Loan Amount & Max Loan Amount).
If the selected value in filer is 2000. It Should not show the 1st Post (Min Loan Amount is 1000 , Max Loan Amount is 100000) in the results.Because the Min Loan Amount of that post is 2000.This is how i wanted it to work. But unfortunately its not working.
Please see the attached image for better understanding.
Trevor(Private) December 23, 2016 at 10:57 am #78451I see the slider has one handle and not 2? What does the url query string look like? Does it perhaps have something like
0+2000
in it? In which case, maybe you would need to use the Edit Query Arguments filter to make this 2000+2000. To see if this works, manually alter the url and hit GO in the browser to refresh/reload the page.Anonymous(Private) December 24, 2016 at 4:44 am #78523I have disabled the 2nd handle.
Usually URL Query looks like below after changing the value.I tried changing the URL manually but no use.
I want to filter the values between 2 post meta fields.
Filtering value should be between the 2 pos meta fields to get the results.
Trevor(Private) December 27, 2016 at 10:04 am #78760I have been playing with the code and this will not work the way you have it. Instead of locking/hiding the upper value, can you lock/hide the lower value and not auto detect it but instead have it a 0? Then, instead of setting the match type to ‘Input within’, make it
Input overlaps
Trevor(Private) December 28, 2016 at 10:27 am #78839As you have it, the visible slider is the
From
slider.Well, whatever you did to lock/hide the
To
slider (the max value) would have to be moved over to theFrom
(min) slider in coding.As to the backend, open that field’s settings and find the
Compare Mode
select box, and change that fromInput must be within the Post Meta range
toInput overlaps any of the Post Meta range
.Anonymous(Private) December 29, 2016 at 4:23 am #79047Trevor,
I have changed the settings as you said but still its not working fine.When i selected “Amount of the Loan” to 43500.
It should show all the loan where Selected loan amount (43500) is between Min Loan Amount value & Max Loan Amount Value.
But now its not working that way.
Can you please check it in the below URL and give me a solution.http://www.cybergiftindia.com/ottobanking/
Thanks
-
AuthorPosts