Calculating fare based on a driving distance using webform

  • Profile Image
    Asked on May 07, 2017 at 09:58 AM

    hi i am pradeep from india. i have opened a cab service. i just want to know about the fare calculator. i am using the wordpress. in that i am using the visual form builder. i want to add a google api. please tell me how to add the field with the script code... 


    if the customer visits our website they will search for cabs by seeing the form

    in that they will chose a origin city and the destination city. so that should be automatically seen and the kms should be calculated by it


    can u pleae tell me

  • Profile Image
    Answered on May 07, 2017 at 10:45 AM

    I would like to suggest trying a Driving Distance widget field on form. The widget will calculate an approximate driving distance based on Google Maps API.

    The driving distance can be also used in combination with custom calculations.

    Demo form:

    However, you will not be able to adjust the code of the Driving Distance widget. If the widget is not flexible enough, you might consider getting a form source code and host it with your custom code modifications on your website.

  • Profile Image
    Answered on May 07, 2017 at 11:43 AM
    sir thanks for replying me... sir how to get this form and how to install
    in wordpress sir...can u help me in this please....
    i want to add currency in indian rupee. the distance calculator is very
    nice sir
    please can u help me out of this
  • Profile Image
    Answered on May 07, 2017 at 12:29 PM

    You can embed the form in Wordpress with the help of these guides:


    If that doesn't work, please use the iFrame method. Here's how: Getting-the-form-iFrame-code.


    The Form Calculation widget doesn't dictate any currency, it is giving a value. As you can see on the formula provided by Mike, it shows ($ DrivingDistance * 3).

    "DrivingDistance" = distance between 2 locations (KM, M etc.)

    "3" = price per distance (KM, M etc.).

    You can change the value of "3" to you preferred amount. After that, you can just replace "$" with "Indian Rupee symbol".

    Please check this guide for more information about Form Calculation: How-to-Perform-Form-Calculation-Using-a-Widget.


    Hope that helps. Thank you.

  • Profile Image
    Answered on May 08, 2017 at 04:12 PM

    I tried this for my site and it does the job. However 1 big issue: when completing the address field on a desktop it has auto-suggestion of Google Maps  while typing. This one is very important topics me, but sadly when completing thé form on my smartphone, this autocorrection just doesn't seem to ben there???
  • Profile Image
    Answered on March 29, 2018 at 05:12 PM


     This works for me... but I would like to add a base pickup rate. How would I calculate that in?