In my View I have set the Ordering to Price Field - Ascending - As a number. And it sort of works. It is reading the numbers by only the first number of the price, and not as a REAL number. Meaning it thinks 1,350,000 is LESS than 699,999, I guess because 1,350,000 starts with a "1"?? How do I get them to descend lowest to highest as real numbers?
Thank you for contacting us and I'd be happy to assist.
I've performed some tests on my website with a "number" type price custom field and it orders the results correctly.
Can you please make sure that your price field is also a "number" type field and you're storing numerical price values like "1350000" and not the values with the thousand separators like "1,350,000"? If you're storing the price values with thousand separators then they will be treated as strings and not numbers.
In case you're already storing the numeric price values and the issue still persists, you're welcome to share temporary admin login details in reply to this message.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.
Hi Waqar,
I totally understand and it works when I make the price field a "number'. However, homes prices are not written without the thousand separators, so is there a way to order the listings by price with the separators? That is what my client wants.
Awesome. I will try today. If I change the Price Field from String to Numbers will I have to re-input all the prices, or in other words will it delete the content in those fields? Right now it is a string field with the thousands separators.
If you'll change your custom field's type to "numeric" or remove the old field and add it again as a numeric field (keeping the same field slug), the field values will stay as it is.
But, those values won't be converted to numbers without the thousand separators automatically and you'll have to update them all manually.