Sort by Distance – Multi Locations

This topic contains 9 replies, has 3 voices, and was last updated by  Vikas 9 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #9070

    nyhotdogman
    Free User
    Post count: 10

    Hi there,

    I am using the multi locations plugin. For some reason the sort by distance (showing nearest first) does not work anymore now. It worked fine when just having ONE location.

    How can this be fixed?

    Thanks,
    Peter

    #9092

    Vikas
    Full Member
    Post count: 1128

    Hi,
    Site link and admin login detail in private reply please.

    Thanks

    #9610

    nyhotdogman
    Free User
    Post count: 10

    Hi,

    quick question:

    What is the “default city” for in the multilocation>manage location settings?

    Thanks,
    Peter

    #9633

    Paolo
    Site Admin
    Post count: 31206

    Is the primary location of your website. The location that users are directed too when 1st visiting your website (if everywhere and geolocation are disabled.)

    Thx

    #9636

    nyhotdogman
    Free User
    Post count: 10

    Hi Paolo,

    thanks for that – could it create issues when changing that primary location (e.g. changing that to a different location and possibly deleting the old primary location – as said we are using multi location) ; we are having some issues in terms of sorting by distance correctly…possibly a database issue?

    Thanks

    #9639

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    if you provide VIkas what he requested we could stop assuming and actually find the solution.

    Thx

    #9650

    nyhotdogman
    Free User
    Post count: 10

    Hi,

    well yeah…our company policies are a bit strict in terms of giving out credentials ; I’ll have to get back on that

    Thanks

    #9651

    Paolo
    Site Admin
    Post count: 31206

    Hi again,

    please remember that we have no interest at all in damaging your company’s servers, instead we have all interest to make your website work as expected. That way you can brag with your colleagues about how awesome our support is and help us sell more licences 🙂 .

    Unfortuantely, with a script like GD where there are so many options, it is almost impossible to guide customer into finding solution without seeing the actual backend (and sometimes even FTP or Database especially in a case like this).

    GeoDirectory is still fairly young and some unexpected behaviours are a possibility.

    Just FYI, right now we are developing a new option page called GD tools, where we are adding various diagnostic scripts that can be runned to spot common option errors and fix them automatically.

    This because we don’t really enjoy having to ask wp-admin all the time too… We hope this will save a lot of time for forum moderators and developes so that we can focus more on new features and addons.

    Thx

    #9738

    nyhotdogman
    Free User
    Post count: 10

    Hi Paolo,

    thanks for your answer. Yes I understand 100%

    My developers were able to fix the issue we were having –> the search results were not sorting by neareast first, as the distance seemed not to be fully correct. This is what my developers did (maybe you can let me know if this is a plugin bug or what the rational behind this is):

    The plugin’s default code for this is:

    $fields .= ” , (“.$DistanceRadius.” * 2 * ASIN(SQRT( POWER(SIN(($mylat – ABS(“.$table.”.post_latitude)) * pi()/180 / 2), 2) +COS($mylat * pi()/180) * COS( ABS(“.$table.”.post_latitude) * pi()/180) *POWER(SIN(($mylon – “.$table.”.post_longitude) * pi()/180 / 2), 2) )))as distance “;

    –> my developers removed the “ABS(..” from this code and then the sort by/distance calculation worked like a charm. The ABS function seems to return absolute values which does not really work for coordiantes (which have a “-“). Is this a bug or did you guys have a reason for adding this?

    Thanks a lot,
    Peter

    #9741

    Vikas
    Full Member
    Post count: 1128

    I have already fixed it and it will be there in next release.

    Thanks

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket