Uni CPO 4 Documentation
  • Introduction
  • Why Uni CPO?
  • Installation
    • Upgrade
  • How To Use
    • Plugin's Settings
    • Builder
      • Data Structure
      • General Settings
      • Non Option Variable (NOV)
      • Weight Conditional Logic
      • Dimensions Settings
      • Image Conditional Logic
      • Formula Conditional Logic
      • Dynamic labels for options/suboptions
      • Shipping Classes Conditional Logic
      • Cart Discounts
    • Basic Modules
      • Row
      • Column
      • Paragraph
      • Button
      • Image
    • Options
      • Text Input
      • Text Area
      • Select
      • Radio Inputs
      • Checkbox Inputs
      • Date Picker
      • File Upload
      • Dynamic Notice
      • Range Slider
      • Matrix
      • Extra Cart Button
      • Google Map
      • Distance by Postcode
      • Font Preview
    • Fields Conditional Logic
    • Validation Conditional Logic
    • Colorify Feature
    • Imagify Feature
    • "Free Sample" Feature
    • Arithmetic Operators
    • Manage Order Items
    • Suboptions export/import
  • For developers
    • Actions & Filters
    • JS events
    • Extending Uni CPO
  • Duplicating options and products
  • How to debug
  • Affiliation
  • Themes & Plugins Compatibility
    • Popup Maker How To
    • Boxtal
    • Pitchprint.com
    • NBDesigner
    • Toggle Tax For Woocommerce
  • FAQ
  • Refund Policy
  • Managing licenses and billing info
    • License Utilization
  • Uni CPO Add-ons
    • Custom dynamic SKU (paid)
      • Stock management based on dynamic SKU
    • "Send Inquiry" (free)
    • Hidden/disabled option (free)
Powered by GitBook
On this page
  • Single mode
  • Dual mode
  • Information about variables

Was this helpful?

  1. How To Use
  2. Options

Distance by Postcode

Makes it possible to get the distance between to addresses (by postcode).

PreviousGoogle MapNextFont Preview

Last updated 4 years ago

Was this helpful?

⚠️ In order to use this option a valid API key must be added on the . The steps of how to get the API key are described on the page about . The following API must be enabled:

Maps JavaScript API

Geocoding API

This option has two modes: single and dual

Single mode

This mode should be used when you need to get distance between your postcode (origin) and user defined (destination). For instance, you want to get the distance for delivery service. You have to define origin's postcode and country in this case.

Dual mode

This mode should be used when you need to let user define both origin and destination postcodes and get distance between these two. In this case you have to define only country.

Why must I define country?

Google distance API works so you have to set country name explicitly, otherwise the will be wrong distance/calculation. This is the limitation of the API.

Information about variables

This options' main variable holds destination postcode value. Additionally, the option has two special variables which ends with:

...origin} - origin's postcode

...distance} - distance between origin and destination, km

In dual mode origin is the first input and the destination is the second:

👉
👉
plugin's settings page
Google Map option
Two modes of the option