Skip Navigation

[Resolved] Getting geolocation from the user to start off a booking process

This support ticket is created 4 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by michielM 4 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1646691
Screenshot 2020-06-01 18.00.05.png
Screenshot 2020-06-01 17.59.49.png

I'm trying to start a booking process from the geolocation of the user. If the user doesn't allow his location to be sent, then he should specify it himself. With that location I want a next page to show locations nearby. How can I do this with Toolset?

Technically I want this:
Page1 - Home:
- input text box filled with automatic geolocation or typed in by user;
- submit button, action=results.php
Page2 - Results:
- on results page I want to show nearby locations

So, no map is needed anywhere.

Thanks in advance,
Michiel

#1646893
Screen Shot 2020-06-01 at 3.19.47 PM.png

Toolset's "distance from User" features are based on the geolocation provided by the browser's geolocation API, not based on user input. Without the browser geolocation provided, Toolset isn't able to make the proper calculations for distance-from-User searches. The geolocation feature is, unfortunately, required for this feature, and there is no other mechanism for providing User location. However, the User can still type any arbitrary location into the location field, and this will still work to provide distance-based searches. No map is required.

You mentioned that you want to split a View's search filters and results into two pages. You can do this with the Block Editor by choosing to show the search filters and results on separate pages (see the attachment here), and you can do it in classic Views by choosing the option to only display the search filters or only the search results when you insert the View shortcode. Let me know if you have questions about this.

#1646925
Screenshot 2020-06-01 21.41.08.png

Hi Christian,

I'm not sure if I'm using Blocks instead of Views (because I'm adding a View in the Block Editor, a bit confusing). But I can't disable the option to not show the results on the same page.

#1646989

I'm getting really a bit annoyed with ToolSet. Almost no documentation seems to be identical to my installation, nothing works the way you'd expect it to do. This time I'm trying to get all results (with or without pagination, with or without limitations): I get only three results! Although I have 21 posts of the type I'm searching for.

UPDATE:
Found a way to show these places. Open them and click "Update". Any thoughts on why? The original posts/locations where created by a non-admin user.

#1647015

What am I doing wrong? How do I add a link to anything in the block editor? How do I go from one item in the result to the item itself? Or anything else?

And now my View has gone and is replaced by a complete different View! While the right view is still visible in the editor, the wrong one is shown in Preview and normally on the front end. This is annoying!!

#1647667
post-link.png
arbitrary-link.png

I'm not sure if I'm using Blocks instead of Views (because I'm adding a View in the Block Editor, a bit confusing).
The terminology is a bit confusing, since these terms represent both plugins and features. Basically there are two plugins - Views and Blocks. Views has been around since before the Gutenberg WP updates, and Blocks has been added recently to fit in with the new Gutenberg WP workflows. Right now, the same core functionality exists in both plugins with a few different configurations (though as you have noticed there are some missing Views features in Blocks that we are trying to add as soon as possible). In the future, Toolset Blocks will be the preferred plugin where new features will be added. A block is one element in the block editor interface (a.k.a. Gutenberg). A View is a listing of some kind of posts, taxonomy terms, or Users. It can be built in the classic Views editor or in the blocks editor. Hope this helps clarify a bit - feel free to create new tickets to discuss any confusion you may still have.

But I can't disable the option to not show the results on the same page.
Typically this indicates that the View was built in the Block Editor rather than in the classic Views editing experience. To get to the classic Views editor, check the Toolset menu to see if there is a "Views" submenu. If not, you must go to Toolset > Settings > General tab, then choose "Show both the legacy and Blocks interface and let me choose which to use for each item I build" in the Editing experience options. Then you will see Views as a submenu of the main Toolset menu item. You can build a new View here with custom search filters, then use a View block to implement the View in the Block Editor with filters and results split into separate pages as shown in my previous post.

UPDATE: Found a way to show these places. Open them and click "Update". Any thoughts on why? The original posts/locations where created by a non-admin user.
Hard to say for sure offhand, but my guess is that the location was not chosen from the Google autocomplete input field. Instead, maybe the User typed something freehand and clicked "save" without choosing from the autocomplete options...maybe? Then when someone edited the post, the maps location field autocomplete was able to guess based on that freehand input, and a properly geolocated address was saved. I would need to know more about the original input, the View criteria, and so forth to give you a more concrete reason. If this continues to occur, let me know and I can split off a separate ticket for more in-depth investigation.

What am I doing wrong? How do I add a link to anything in the block editor? How do I go from one item in the result to the item itself?
If you want to add a link to the post in the results of a View, you can place the Single Field block in the View's loop. In the field source configurations, choose the Standard Field option and "Post title with link" from the current post (see post-link.png). Another option is to use the Fields and Text block, if you want to add more text and format a link inside some other text. If you want to create an arbitrary link to some off-site webpage, use a paragraph block, highlight the text you want to make a hyperlink, and click the link icon that appears above the paragraph block (see arbitrary-link.png) to configure the link destination. If you want to show a link to some URL that is held in a custom field on the current post, again you could use the Single Field block but choose "Custom field" instead of "Standard field" in the field source configurations.

And now my View has gone and is replaced by a complete different View! While the right view is still visible in the editor, the wrong one is shown in Preview and normally on the front end. This is annoying!!
May I log in and take a look to see what you're describing? Hopefully this is just a minor configuration issue and not indicative of a bigger problem. Please provide login credentials in the private reply fields here, and let me know where can I see the problem in wp-admin.

#1648033
Screen Shot 2020-06-02 at 2.29.49 PM.png

You're talking about the homepage, correct? The reason the page looks different in wp-admin and on the front-end of the site is because a Content Template has been applied to the page. See the screenshot here. Whatever you place in Template for Horeca zaken will be displayed on the front-end of the site when the homepage is loaded:
hidden link

You can place the post content (post body) in your Content Template using the Single Field block, and whatever you have designed in the post body will appear in that block in your Content Template. Or, you can simply choose to use no Content Template when displaying this post.

Quick word of advice: disable and delete the Toolset Layouts plugin if you are using the Block Editor. There's no need to use both tools, since they both serve the same purpose of drag-and-drop editing. Layouts was around before Gutenberg, and it's not under active development anymore since Blocks is now available.

#1649395

My issue is resolved now. Thank you!

This project has been put on hold, hopefully it will restart or another project that needs ToolSet will come up. Thank for now!