Drop down order

This topic contains 4 replies, has 2 voices, and was last updated by

 
Participant
2 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #24355

    Participant

    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
    Matt

    #24364

    Hi 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 :)


    #24367

    Participant

    HI 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
    Matt

    #24370

    Hi,

    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.
    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.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #24371

    Participant

    Hi Earnest,
    Thanks for your quick reply.
    I’ll use the slider!
    Cheers
    Matt

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.