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-
AuthorPosts
-
June 3, 2019 at 11:30 pm #490698
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.
June 4, 2019 at 5:23 am #490712The Location page works with GD Listings with the option for “Enable Location Filter” for each GD Listings element.
June 4, 2019 at 7:56 am #490722The 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.
June 4, 2019 at 6:53 pm #490833I’ll check this out in the morning, looks like its not picking up the location filter setting.
Stiofan
June 4, 2019 at 7:00 pm #490837Thank 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.
June 5, 2019 at 2:48 am #490903A reminder that neither GD > Categories nor GD > Listings widgets are filtering according to the location. They show everything no matter what’s around.
June 5, 2019 at 2:22 pm #491013I 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
June 5, 2019 at 4:13 pm #491021This reply has been marked as private.June 5, 2019 at 5:40 pm #491032Checking 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
June 5, 2019 at 5:50 pm #491033You’re right, I also see the issue in that URL. Thanks for looking into it!
June 5, 2019 at 8:11 pm #491069For 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.
June 6, 2019 at 12:05 am #491130Updated 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.”
June 6, 2019 at 11:50 am #491231I 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
June 6, 2019 at 4:12 pm #491291Thanks 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+.
June 7, 2019 at 6:14 am #491473GD 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.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket