[Resolved] Number field for price on properties – Views filter not sorting properly
This thread is resolved. Here is a description of the problem and solution.
Problem:
How to allow comma to view's number field filter
Solution:
You can use view's filter hook wpv_filter_query to modify the view's query on fly and adjust it as per your requirement by hooking custom query filters to it.
Hello. Thank you for contacting the Toolset support.
Well - the results you are getting is expected one since your custom field "Listing price" contains commas that means it is not a numeric value but a string value, for filter and custom field for your listing price must be setup as numeric field.
Have you changed your "Listing Price" field type to numeric or removed the comma now?
I switched some things up, but there is still an issue.
First, yes the field is numeric. I am no longer displaying a drop down, I am using a free form search for price.
Second, none of my entries have commas or decimals ... They are all just numbers.
The issue:
I can't control what a person types for a search...They are likely going to put commas in their price entries. When commas are used, no results are found.
If you do not know how to do that, I need access details and I'm happy to fix this on your behalf. But I need one test case example with input that what values we should use as input and what should be the expected results. It will help me for testing and to share your required solution.