Promotion

A promotion discount on a bookable item.

A promotion discount on a bookable item. Available on variant.promotion, package.promotion, and extra.promotion.

Properties

active

Whether the promotion is currently active.

Returns: Boolean — true when today is on or after the start date, the promotion has not been manually expired, and any end date is still in the future.

category

The promotion category as a humanised label.

Returns: String or nil — one of "Early release", "Special offer", or "Last minute". nil when uncategorised.

dates

A humanised string of the promotion's active date range.

Returns: String or nil — e.g. "7 - 14 August 2019", or nil when no dates are configured.

discount_amount

Deprecated

Use promotion.discount_amount_fractional or promotion.discount_percentage instead. Use promotion.discount_is_percentage to choose which to read.

A formatted string of the discount for display.

Returns: String or nil — e.g. "30%" or "$25.00". nil when there is no current currency.

discount_amount_fractional

The fixed discount amount in the subunit of the current currency.

Returns: Integer or nil — e.g. 1250 for £12.50. nil when the promotion is a percentage discount.

discount_is_percentage

Whether this promotion applies a percentage discount.

Returns: Boolean

discount_percentage

The percentage discount for this promotion.

Returns: Integer or nil — e.g. 30 for 30% off. nil when the promotion is a fixed monetary amount.

ends_on

The date the promotion ends.

Returns: Date or nil — nil when the promotion has no end date.

id

The promotion's unique identifier.

Returns: String — a UUID.

name

The promotion's display name.

Returns: String

starts_on

The date the promotion becomes active.

Returns: Date or nil

tagline

The promotion tagline with discount and expiry placeholders filled in.

Returns: String or nil — uses the current currency when interpolating monetary values.

On this page