Geolocation (Pro feature)
Last updated
Last updated
With Geolocation in the Cost Calculator, you can ask for your customer's current location to begin calculations. They can also manually choose starting and ending points to figure out the distance and cost between two places. This feature is handy for mover or delivery services.
There are settings of the Geolocation element to set up the Map API to work with Calculator:
Map provider: Choose the map provider for the integration.
API key: Paste the API key you generate.
Measuring unit: Choose the measuring unit to calculate the disctance.
In the Global Settings, choose the map provider.
Go to the Google Cloud Console.
Click on "Create Project" to start a new Cloud project.
Fill in the details and click Create.
First, make sure you've set up a billing account and created a project in the Google Cloud Console. Don't worry, actual usage of the Embed API is free of charge.
On the project selector page, this popup will show up. You need to ensure that billing is enabled for your Cloud project. To do that, click on Link a Billing Account.
If you don't have any billing accounts you should create one by clicking Create Billing Account.
Fill in the account information, choose the country and click Agree & Continue.
You need to fill in the payment verification information.
After setting up, you can start using the Google Maps Platform APIs and SDKs. You can find the Google Maps Platform APIs and SDKs that you can enable by visiting the Maps API Library page in the Cloud Console and clicking on the project.
The API key will show up and you need to copy that API key.
To use the Google Maps Platform, enable Maps JavaScript API for your project from this page.
Paste the API key to the API key field.
Choose the measuring unit: kilometers or miles and save the changes.
Name: Put the name for the geolocation field.
What do you want to use geolocation for: Choose from three options:
Request user's location: The calculator will let you get the customer's location and determine the distance and cost from your place to your customer's location.
Ask users to choose starting and destination points: Your customers can calculate the distance and cost between two locations. It can be used for taxi and mover services.
Ask to choose one among multiple locations: You can let your customers choose one of multiple locations. They will choose a branch or pick-up point.
Calculate cost of distance: Enable this option if you want your customers to calculate the cost.
Add your location: Here you can add your location so that your customers can get the cost from their place to yours.
How to calculate the cost: You can define how you can calculate the cost.
Fixed cost per km/mile
Cost: Define the cost per km/mile.
Ranged price for the distance
Distance range: You can put the distance range.
Range cost: Detail the cost for each range.
Add another range: You can add another range and put the cost.
Currency Sign - Enable if you want to show the currency symbol in the total summary.
Required - Defines whether the element will be required to be filled or not.
Hidden by Default - The element will be hidden until a corresponding condition is met.
Calculate hidden by default - If any case hides the element: via the Hidden by Default setting or hidden by some condition, the element's default value (if it is set) will be counted in the formula
Show in Grand Total - Disable if you want to hide the element in Grand Total.
Additional Classes - Add extra classes to the HTML elements to further style changes.
Let's take a Delivery Service template.
Drag and drop the Geolocation element.
Put the name for the element.
Choose what you want to use the field for.
Enable calculating the cost of distance.
Add your location by clicking on Select location.
Search for your location and save.
Select how you want the cost for the delivery to be calculated.
Add the cost per kilometer.
Save the changes.
This is how your users will see it:
To use the Geolocation Element with Conditions, go to the Conditions tab.
Add fields you want to connect and create a connection between them.
Click on the pencil icon and add a condition.
Choose one of the Condition options available.
Add a value for the condition.
Select a condition action and save the changes.
We have set up the conditions so that when the distance is greater than 150 kilometers, the calculator will show the option for the package to be delivered by air. This is how it will work for your users.
There will be a link to the address in Orders.