Your address will show here +12 34 56 78

This topic contains 7 replies, has 3 voices, and was last updated by  simonben 2 years, 6 months ago.

  • Author
    Posts
  • #14256

    Lee Bumstead

    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.

  • #14408

    crerem

    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

  • #14453

    Lee Bumstead

    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.

  • #14997

    Lee Bumstead

    Bump up

  • #15082

    crerem

    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
    )
    );

  • #15139

    Lee Bumstead

    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.

  • #39536

    Anna
    Keymaster

    Update

    Replace default variables with these values. Should work.

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

    Thank you
    Anna

  • #105500

    simonben
    Participant

    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.