CarrGo Astro documentation

Fares and the estimator

Set your rates and fixed airport fares, and show riders a price before they book. No maps service or API key needed.

Every price on the site comes from fares in src/site.config.ts, together with each vehicle’s price multiplier. Change a rate once and the estimator, the fixed-fares tables and the fleet cards all update.

Rates

Setting What it does
currency The currency code, such as USD, GBP, EUR or INR.
locale How prices and dates are written, such as en-US, en-GB or de-DE.
unit km or mi. Used in the estimator and on fleet cards.
base The pickup charge added to every trip.
perUnit The price per km or mile.
perMinute The price per minute of driving.
minimum No estimate goes below this.
night multiplier, from and to: the night rate and its hours on a 24-hour clock.
note The small print under the estimator and fixed-fares tables. Set it to '' to hide it.

Fixed fares

fixed lists your airport runs and popular routes, priced for a standard car:

fixed: [
  { group: 'Airports', from: 'City centre', to: 'Northfield International (NFI)', price: 45, time: '35 min', distance: 28 },
  { group: 'Stations & ports', from: 'City centre', to: 'Central Station', price: 14, time: '12 min', distance: 5 },
],

Routes with the same group share a table. A group name containing “air” gets a plane icon, one containing “station” or “port” gets a train icon, and anything else gets a route icon.

To show only some groups, list them in the block:

- type: fares
  variant: table
  groups: [Airports]

How the estimator works out a price

The estimator has two modes.

  • Fixed routes: the route’s fixed price times the chosen vehicle’s multiplier.
  • By distance: the visitor types the distance and driving time. The price is the pickup charge, plus distance × rate, plus minutes × rate, raised to the minimum if it’s lower. That is then multiplied by the vehicle’s multiplier, and by the night rate if the visitor ticks Night trip.

Prices are rounded to whole units of your currency. Distance-mode prices show the breakdown and are labelled Estimated fare; route prices are labelled Fixed fare.

Everything is worked out in the visitor’s browser. Nothing is sent to a maps service, so there’s no API key or bill. The first route’s price is already in the page, so it shows even before the script runs.

Vehicle prices

Each vehicle file in src/content/fleet/ has a multiplier: 1 is the standard price, and 1.6 is 60% more. The fleet cards show each vehicle’s rate per km or mile (perUnit × multiplier). See Fleet, services and cities.

The three fares blocks

Variant What it shows
estimator The calculator on its own.
table The fixed-fares tables.
split The tables beside the calculator, which stays in view as you scroll. The Fares page uses this.