How do I create tiered delivery charging?

  • saltersevents
    Asked on February 7, 2021 at 11:36 AM

    I'm currently charging a flat fee for delivery. I'd like to have a tiered delivery charge, based on the distance of the delivery. i.e. the further away the delivery address is from my location, the higher the delivery charge. I'd also like to offer free collection if customers would like that option. I don't know how to do either.

    Would it be possible to add a picture of my delivery zones showing the different prices for delivery?

  • John Support Team Lead
    Replied on February 7, 2021 at 1:24 PM

    You can try adding the Driving Distance calculator widget to your form. This smart widget will return the approximate driving distance between two locations anywhere in the world. You can configure the originating distance, and let users enter their address or postal code, which the widget will assist by auto-completing the user address.

    Let me create a demo form to better illustrate how it works. I will get back to you here shortly.

  • John Support Team Lead
    Replied on February 7, 2021 at 4:26 PM

    As checked, you have incorporated the DELIVERY FEE in the Stripe field:

    1612728964 60204a84885be  Screenshot 10

    Unfortunately, the workaround that I'm planning to present will not work on this setup.

    You would need to create the products outside the Stripe field. Here it is:

    1.) Here I used SPINNER fields:

    1612730240 60204f80d1ef3  Screenshot 21

    2.) I then added a FORM CALCULATION widget for the SubTotal:

    1612730452 60205054ad9fd  Screenshot 32

    As you can see, I have multiplied each spinner to the product price it represents then add the results.

    3.) Next, add the DRIVING DISTANCE CALCULATOR widget. You would need to have a Google Billing account for you to use it. https://developers.google.com/maps/documentation/javascript/get-api-key

    This requires the user to input the ORIGIN and DESTINATION LOCATION. And based on the distance, we will calculate the cost - please set a base price.

    4.) Add another FORM CALCULATION widget. This will be the TOTAL (SubTotal plus the Delivery Cost). Here's the formula you can use:

    1612732997 60205a45059f2  Screenshot 43

    5.) Lastly, pass the calculated value to the Stripe field for the user to complete the payment. Here's a guide on how-to-pass-a-calculation-to-a-payment-field.

    And that's it! I have implemented this on a cloned form. Here's a link that you can try: https://form.jotform.com/210376298311959