Bug: Near me button / Location page show listings that are not near me.

This topic contains 19 replies, has 3 voices, and was last updated by  Directory Path 5 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #490698

    Directory Path
    Expired Member
    Post count: 235

    Steps to reproduce.
    1. go to https://wpgeo.directory/starter
    2. click on near me
    3. you should see only results near you, but it shows listings, categories, and pins that are not related to your location.

    I don’t what’s in the code for the demo, but on the default installation the Location page has this:
    [gd_listings post_limit=10]
    This only shows 10 locations with no regards for the location.

    The expected behavior for the Near Me / Location page is to show only show listings near you, and therefore only categories and pins associated with these listings.

    #490712

    Alex Rollin
    Moderator
    Post count: 27815

    The Location page works with GD Listings with the option for “Enable Location Filter” for each GD Listings element.

    https://wpgeodirectory.com/docs-v2/templates/location/

    #490722

    Directory Path
    Expired Member
    Post count: 235

    The GD > Categories widget does not have this option enabled, and although the GD > Listings does, the listings there are not near me and are not the ones shown in the map.

    If you go on https://wpgeo.directory/starter/ and click near me, the maps shows “No Records Found
    Sorry, no records were found. Please adjust your search criteria and try again.”
    But all the categories are and several listings too.

    If there are no listings near me, there shouldn’t be any category or listing in the page.

    #490833

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I’ll check this out in the morning, looks like its not picking up the location filter setting.

    Stiofan

    #490837

    Directory Path
    Expired Member
    Post count: 235

    Thank you. While you’re there, there is a significant 3-4 second delay between clicking the button, and being redirected to the location page.

    To simulate:
    1. Open an incognito window
    2. click the near me button on https://wpgeo.directory/starter/

    Thanks again.

    #490903

    Directory Path
    Expired Member
    Post count: 235

    A reminder that neither GD > Categories nor GD > Listings widgets are filtering according to the location. They show everything no matter what’s around.

    #491013

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I don’t see any delay after hitting the near me but i’m testing from desktop. The way the near me works is a standard browser function, it asks for the GPS and it will try and return it, if you have a device with GPS it will check the freshnes and if its old it may try to get a fresh reading, i would guess the incognito triggers this each time. (though your issue may not e related, if you can provide any more info on the matter please do).

    For the Near me thing, it seems to be working mostly in my localhost but without the listed distances, for distances i don’t think the fix will make it into todays release, Kiran is off today and i want to run over the best implementation of the ajax paging with him tomorrow, likely we will still release the fix later in the week.

    Thanks,

    Stiofan

    #491021

    Directory Path
    Expired Member
    Post count: 235
    This reply has been marked as private.
    #491032

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Checking on my mac with chrome i also seen the delay but only the first time, i could not replicate after that. I see a few bugs mentioning it from last year so i guess its still around in some fashion, seems to be a Mac OS + Chrome issue, i was also able to recreate first time here: https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation

    Seems unrelated to GD, but thanks for providing more info.

    Stiofan

    #491033

    Directory Path
    Expired Member
    Post count: 235

    You’re right, I also see the issue in that URL. Thanks for looking into it!

    #491069

    Directory Path
    Expired Member
    Post count: 235

    For this next update, if it’s not too much work, can you please add a class to the geodir-post-rating div if the listing has no reviews? If you add a new class with a unique name, such as “gd-rating-no-rating-yet”, it won’t break previous installations and we can chose to hide it or display different content without having to edit PHP files.

    #491130

    Directory Path
    Expired Member
    Post count: 235

    Updated to .61. Both Categories and Listings are still unaffected by the location.

    Quoting original issue:
    ” Steps to reproduce.
    1. go to https://wpgeo.directory/starter
    2. click on near me
    3. you should see only results near you, but it shows listings, categories, and pins that are not related to your location.

    I don’t what’s in the code for the demo, but on the default installation the Location page has this:
    [gd_listings post_limit=10]
    This only shows 10 locations with no regards for the location.

    The expected behavior for the Near Me / Location page is to show only show listings near you, and therefore only categories and pins associated with these listings.”

    #491231

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I have updated the content that is installed on install but you will need to update that manually in the location page, please change the listing shortcode to

    [gd_listings post_limit=10 add_location_filter='1']

    For the rating i have added a class and a data value to the first inside div (which will still give you the same effect)
    It will look something like this for a 3.5 rating:

    <div class="geodir_post_meta gd-rating-info-wrap gd-align-left gd-lv-s-2  geodir-post-rating-value-3" data-rating="3.5">

    Thanks,

    Stiofan

    #491291

    Directory Path
    Expired Member
    Post count: 235

    Thanks Stiofan.

    The shortcode worked. In case there are more than 10 listings returned, how should we do pagination? There were 6 listings around us, we set the post_limit to 2 and added a GD > Loop Paging, but pagination didn’t show. Would the GD > Listing widget with “Enable Location Filter” also work for the next release?

    Thanks for adding the parameter to rating. Looking forward to the update.

    Categories are still not working. We a 1-1 associating between categories and listings, and there are 6 listings around us. 6 Categories should appear, but we get all 30+.

    #491473

    Alex Rollin
    Moderator
    Post count: 27815

    GD Loop is for Archive and Search pages.

    GD Listings has pagination and max post settings both, try those.

    The Post Limit is what sets how many listings show per page.
    If there are 100 listings that would show, and you set the Post Limit to 2, then there would be 50 pages.

    
    
    
    [gd_listings post_type="gd_place" sort_by="az" title_tag="h3" layout="5" post_limit="2" add_location_filter="1" view_all_link="1" with_pagination="1" top_pagination="1" bottom_pagination="1" pagination_info="after"]
    

    GD Categories in the location page filters based on the URL and shows all categories IN that location.

    To see it work, try this page, then the next

    https://wpgeo.directory/supreme-directory/location/united-states/california/

    https://wpgeo.directory/supreme-directory/location/united-states/

    Max posts per page is a WP setting that applies to GD Loop and can be found in WP – Settings – Reading – Posts per page.

Viewing 15 posts - 1 through 15 (of 20 total)

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount