Geolocation (Pro feature)

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.

Geolocation Global Settings

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.

Setting up the Integration between Cost Calculator and Map Provider

  1. In the Global Settings, choose the map provider.

  1. Click on "Create Project" to start a new Cloud project.

  1. 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.

  1. 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.

  1. If you don't have any billing accounts you should create one by clicking Create Billing Account.

  1. Fill in the account information, choose the country and click Agree & Continue.

  1. You need to fill in the payment verification information.

  1. 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.

  1. The API key will show up and you need to copy that API key.

  1. To use the Google Maps Platform, enable Maps JavaScript API for your project from this page.

  1. Paste the API key to the API key field.

  1. Choose the measuring unit: kilometers or miles and save the changes.

Geolocation Element Tab

  • 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.

Geolocation Settings Tab

  • 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.

  • 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.

Using a Geolocation Element

  1. Let's take a Delivery Service template.

  1. Drag and drop the Geolocation element.

  1. Put the name for the element.

  1. Choose what you want to use the field for.

  1. Enable calculating the cost of distance.

  1. Add your location by clicking on Select location.

  1. Search for your location and save.

  1. Select how you want the cost for the delivery to be calculated.

  1. Add the cost per kilometer.

  1. Save the changes.

This is how your users will see it:

Using the Conditions

  1. To use the Geolocation Element with Conditions, go to the Conditions tab.

  1. Add fields you want to connect and create a connection between them.

  1. Click on the pencil icon and add a condition.

  1. Choose one of the Condition options available.

  1. Add a value for the condition.

  1. 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.

Last updated