Contents

Pricing - Plugixa Car Parking

Every price is worked out on your server. The booking form asks the server for a quote each time the customer changes the dates, the space type, the number of spaces or the coupon, and the server prices the booking again when it is saved. The amounts stored on the booking come from that second calculation. A booking request carries the location, the space type, the dates, the quantity and the coupon code; it carries no price, so there is no browser-sent amount to trust.

A booking you create in the admin is priced by the same calculation.

The inputs

Input Where it is set
Billing unit The Billing unit of the location.
Price per unit The Prices panel of the space type.
One-off fee The same panel.
Entry and exit Chosen by the customer.
Number of spaces Chosen by the customer. At least 1.
Coupon code Typed by the customer. See Coupons.

Step 1: the billing unit

A stay is billed in the unit of the location being booked: per minute, per hour, per day, per week or per month. Every location stores its own unit, and a new location starts on Per day.

The Default billing unit in Settings does not change how an existing location is billed. To change the unit of a car park, edit the location.

Step 2: the number of units

The length of the stay is divided by the length of one unit, and a part unit is rounded up. The minimum is one unit.

Unit Length
Minute 60 seconds
Hour 60 minutes
Day 24 hours
Week 7 days
Month 30 days

Examples:

  • A stay of 25 hours billed per day is 2 days.
  • A stay of 90 minutes billed per hour is 2 hours.
  • A stay of 10 minutes billed per day is 1 day.
  • A stay of 31 days billed per month is 2 months.

Step 3: the price of one unit

The price is read from the space type, for the unit the location is billed in.

  1. If the space type has a price for that unit at this location, that price is used.
  2. Otherwise the space type’s general price for the unit is used.
  3. If neither exists, the price is 0.

The one-off fee is looked up the same way.

A space type with no price for the location’s billing unit is therefore booked for free. A location billed per hour needs a Per hour price on each of its space types; a Per day price is not converted.

Step 4: pricing rules

With Pro, pricing rules PRO run next. A rule that matches the booking changes the price of one unit or the one-off fee: it sets it, raises it or lowers it, by an amount or by a percentage. A price never goes below 0.

Rules can be limited to customer groups PRO, which is how one group of customers gets its own price.

When a rule changed a price, the line on the customer’s order shows the price before the change and each adjustment under the rule’s own name.

Step 5: the lines

The order is built from lines.

Line Amount
Booking fee one-off fee x number of spaces. Left out when there is no fee.
Parking, labelled like “2 spaces x 3 days” units x price of one unit x number of spaces
Extras PRO One line per extra the customer chose.

Their sum is the subtotal.

Step 6: the coupon

A valid coupon is taken off the subtotal, extras included.

Coupon type Discount
Percentage subtotal x percentage / 100, rounded to two decimals
Fixed amount The amount, but never more than the subtotal

A code is checked again when the booking is saved. A code that does not apply takes nothing off and the booking is priced without it. With Accept coupon codes switched off in Settings, no code is read at all.

Step 7: tax

With Pro, tax rates PRO are charged on what is left after the discount, so tax is never worked out on money the customer did not pay. Each rate that applies to the location adds its own line.

Step 8: the total

total = subtotal - discount + tax

The total cannot be negative. The subtotal, the discount, the tax and the total are each rounded to two decimals when they are stored on the booking.

Step 9: the amount due now

Without Pro the whole total is due. With deposits PRO switched on for the location, the part to pay now is a percentage of the total, rounded to two decimals. The rest stays due on the booking.

A worked example

The starter location, Main Car Park, is billed per day. Its Standard space type costs 10.00 per day and has no one-off fee.

A customer books 2 spaces from Friday 08:00 to Sunday 10:00 and enters a coupon worth 10 percent.

Step Calculation Result
Length of stay Friday 08:00 to Sunday 10:00 50 hours
Units 50 / 24 = 2.08, rounded up 3 days
Parking line, “2 spaces x 3 days” 3 x 10.00 x 2 60.00
Subtotal 60.00
Coupon, 10 percent 60.00 x 10 / 100 -6.00
Total 60.00 - 6.00 54.00

With Pro, a tax rate of 20 percent and a deposit of 25 percent, the same booking continues:

Step Calculation Result
Tax, 20 percent 54.00 x 20 / 100 10.80
Total 60.00 - 6.00 + 10.80 64.80
Due now, 25 percent 64.80 x 25 / 100 16.20

If the same location were billed per hour, the stay would be 50 hours at the Per hour price of 2.00: 50 x 2.00 x 2 = 200.00.

How amounts are written

Amounts are stored as numbers. How they are written on the booking form, the summary, emails and invoices follows five options in Settings:

Option Default
Currency symbol $
Symbol position Before the amount
Thousands separator Comma
Decimal separator Full stop
Decimal places 2
  • With no thousands separator, digits are not grouped.
  • With 0 decimal places, no decimal separator is written.
  • A negative amount, such as a discount line, carries a minus sign in front of the symbol.

Decimal places changes how an amount is written, not how it is stored: totals are rounded to two decimals whatever the setting.

Every amount is in one currency. A location can carry its own currency code, which is recorded on its bookings, but amounts are still written with the symbol from Settings and nothing is converted.

When prices change

A new price applies to quotes and bookings made from then on. Existing bookings keep the amounts they were saved with.

A booking that is moved to other dates is priced again for the new dates, at today’s prices, and its total and lines are replaced. A stay that gets longer costs more and one that gets shorter costs less. The coupon the booking redeemed stays applied, even if the code has since expired or been used up. Payments already recorded are not touched. See Bookings and Reschedule PRO.

For developers

Each step is a filter, and the Pro features above are ordinary listeners on them. See the Hooks reference.

Filter Step
plugixa_carparking_base_charge Change the price of one unit or the one-off fee
plugixa_carparking_quote_lines_before_discount Add lines to the subtotal
plugixa_carparking_quote_lines_after_discount Add lines charged on the discounted amount
plugixa_carparking_quote_due_now Set the part of the total to take now
plugixa_carparking_quote Adjust the finished quote

Quick Links