Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Drop down order
This topic contains 4 replies, has 2 voices, and was last updated by mattand2707 3 years, 7 months ago.
- AuthorPosts
- October 17, 2019 at 9:26 am #24355
Hi,
I have a drop down in my Ajax Pro property searcher. It gets a number from a custom field “number of rooms”. How do I get the drop down to show those numbers in order, ie: 1 2 3 5 8 12 22 etc.? I can put the numbers in manually (in order, ie 1 2 3 4 5 6 7 8 9 10 etc) but I want to get the numbers from the custom field, ie where they exist in the custom field so that a result always comes up. Currently when I get the numbers from the custom field they don’t show up in order in the drop down. I’ve been through the settings and documentation but can’t find the solution.
Other than that, great plugin and perfect for my requirements.
Many thanks
MattOctober 18, 2019 at 9:38 am #24364Hi Matt,
It should get them in ascending order by default. Do you happen to use Advanced Custom Fields plugin by any chance? In that case, the plugin requests the values from ACF, and returns them as they are requested.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 18, 2019 at 10:03 am #24367HI Earnest,
Thanks for your quick reply.
No I dont use ACF. I use WPAllimport to get the values into the custom fields.
The numbers are kind of in order but they go
1
10
11
12
2
28
3
4
..etc
where they should go
1
2
3
10
11
28
etc
Any ideas of how to get them more like this?
If not I’ll use the range slider!
But a great plugin nevertheless!
Cheers
MattOctober 18, 2019 at 1:46 pm #24370Hi,
Oh okay, I see the problem now – the database stores this information as “strings” not as numeric values, and in that case the order is basically correct.
Best,
Well, the best way would be to either enter the values manually, or rather use the slider filter – as I am not sure if it can be resolved without editing the code directly.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 18, 2019 at 1:51 pm #24371Hi Earnest,
Thanks for your quick reply.
I’ll use the slider!
Cheers
Matt - AuthorPosts
You must be logged in to reply to this topic.