• Lee Bumstead
    December 22, 2013 at 11:39 am #14256

    Hi Anna,

    Hope you are well and looking forward to Christmas.

    I have a quickie question.

    Almost there to go live, and in the process of adding all my available properties.

    So the question is, on the Advanced Search page, how can I make my properties display in price order, from low to high?

    Many thanks in advance,

    Cheers, Lee.

    crerem
    December 23, 2013 at 10:30 am #14408

    Hello,
    In advanced-search-results.php go to line 345 (or around – depends on your version) and edit the $args array.

    Instead of
    meta_key’ => ‘prop_featured’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’,

    put

    ‘meta_key’ => ‘property_price’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’,

    Thanks

    Lee Bumstead
    December 23, 2013 at 4:23 pm #14453

    Thanks Crerem,

    Already done that one. But all it does is show from High to Low, and splits the list between flats and houses.

    I really need low to high for all properties, no spilt between types.

    Cheers, Lee.

    Lee Bumstead
    December 27, 2013 at 8:25 pm #14997

    Bump up

    crerem
    December 28, 2013 at 9:48 am #15082

    Please post her the args array . It should look something like

    $args = array(
    ‘post_type’ => ‘estate_property’,
    ‘post_status’ => ‘publish’,
    ‘paged’ => $paged,
    ‘posts_per_page’ => 30,
    ‘meta_key’ => ‘property_price’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’,
    ‘meta_query’ => $meta_query,
    ‘tax_query’ => array(
    ‘relation’ => ‘AND’,
    $categ_array,
    $action_array,
    $city_array,
    $area_array
    )
    );

    Lee Bumstead
    December 28, 2013 at 5:42 pm #15139

    Looks exactly as you have posted :-

    $args = array(
    ‘post_type’ => ‘estate_property’,
    ‘post_status’ => ‘publish’,
    ‘paged’ => $paged,
    ‘posts_per_page’ => 30,
    ‘meta_key’ => ‘property_price’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => ‘DESC’,
    ‘meta_query’ => $meta_query,
    ‘tax_query’ => array(
    ‘relation’ => ‘AND’,
    $categ_array,
    $action_array,
    $city_array,
    $area_array
    )
    );

    But shows high to low, and split between different types of property. What I am after is a low to high list for everything (no split).

    Cheers, Lee.

    Anna
    May 29, 2014 at 4:22 pm #39536

    Update

    Replace default variables with these values. Should work.

    ‘meta_key’ => ‘property_price’,
    ‘orderby’ => ‘meta_value_num’,
    ‘order’ => ‘DESC’,

    Thank you
    Anna

    simonben
    April 2, 2015 at 12:23 pm #105500

    That doesn’t work Anna.

    It lists properties as follows:

    £950,000
    £900,000
    £90,000
    £850,000
    £8800,000

    It lists properties by NUMBER, not price.

You must be logged in to reply to this topic.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.