Advanced Search Radius by km instead of miles

  • Finda
    Finda
    Newbie 6 points
    August 5, 2013 at 4:39 am

    Hi Mark,

    How can I change the postcode search radius to km instead of miles please?

    Thanks
    Jenn

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    August 5, 2013 at 2:53 pm

    ill see about adding an option into a future release, for now you could simply change the text.

  • Conny
    Conny
    Newbie 38 points
    December 30, 2014 at 6:20 pm

    Sorry for to re-open the question. Any change on this ? I added to advanced search postal code and it is still showing miles instead of kilometer (preference set on general setup).


  • Christopher
    Newbie 6 points
    January 3, 2015 at 4:07 am

    Hi Conny,
    This is what I did to make the radius search in km’s.
    You need to change the default code of class_search.php lines 1577-1595 to something like the following:

    if($field->description != "off"){
    echo "<br /><small>".$CORE->_e(array('widgets','2')).":</small>
    <select name='radius' class='form-control input-sm'>
    <option value='12.4' selected='selected'>".$CORE->_e(array('widgets','3'))."</option>
    <option value='6.2'";
    if(isset($_GET['radius']) && $_GET['radius'] == "6.2"){ echo "selected=selected "; }
    echo ">10 ".$CORE->_e(array('widgets','4'))."</option>
    <option value='12.4'";
    if(isset($_GET['radius']) && $_GET['radius'] == "12.4"){ echo "selected=selected "; }
    echo ">20 ".$CORE->_e(array('widgets','5'))."</option>
    <option value='24.9'";
    if(isset($_GET['radius']) && $_GET['radius'] == "24.9"){ echo "selected=selected "; }
    echo ">40 ".$CORE->_e(array('widgets','5'))."</option>
    <option value='37.3'";
    if(isset($_GET['radius']) && $_GET['radius'] == "37.3"){ echo "selected=selected "; }
    echo ">60 ".$CORE->_e(array('widgets','5'))."</option>
    <option value='49.7'";
    if(isset($_GET['radius']) && $_GET['radius'] == "49.7"){ echo "selected=selected "; }
    echo ">80 ".$CORE->_e(array('widgets','5'))."</option>
    <option value='62.1'";
    if(isset($_GET['radius']) && $_GET['radius'] == "62.1"){ echo "selected=selected "; }
    echo ">100 ".$CORE->_e(array('widgets','5'))."</option>

    Of course you will also have to go the the language options in the theme settings and change the text of mile, and miles to km, and km’s.

    Also, these changes will have to be saved when updating the version since it is part of the core framework.


  • Christopher
    Newbie 6 points
    January 3, 2015 at 4:11 am

    I have attached a picture to show some of the text that was cut off above.

    This example will default the “auto” for search radius to 20km and provide the following radii searches: 10, 20, 40, 60, 80, and 100.

    The main part of this you are looking for is the conversions which are: 6.2, 12.4, 24.9, 37.3, 49.7, and 62.1.

    Attachments:
    You must be logged in to view attached files.
  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    February 25, 2015 at 9:49 pm

    Mark on August 5, 2013

    ill see about adding an option into a future release, for now you could simply change the text.

    WHEN ARE YOU GOING TO ADD THIS ? THIS IS A SERIOUS ISSUE.

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    February 26, 2015 at 7:35 am

    its already in the admin under MISC -> GEO settings -> Distance Unit

  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    February 26, 2015 at 1:58 pm

    @Mark, Have you read by thread, it says,

    We can make the all distance setting in kms, Geo Settings. But then also, the postcode search is shown in miles.

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    February 28, 2015 at 7:44 am

    thanks, fixed in the upcoming update.

  • Hemanta Chakladar
    Hemanta Chakladar
    Super Guru 1,710 points
    February 28, 2015 at 7:59 am

    Thanks for taking this into account.

  • Mark Fail
    Mark Fail
    Super Guru 13,013 points
    February 28, 2015 at 8:06 am

    np

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

New Business Themes for WordPress 2020

Start your new website today!

View Business Themes