Reference

Ticket

Whenever you’re dealing with a ticket in your template, you’re actually working with a Ticket object.

Properties

id

The ID of the ticket.

title

The ticket title.

event

The ticket’s associated Event.

eventId

The ID of the event this ticket belongs to.

type

The ticket’s associated ticket type.

typeId

The ID of the ticket’s type.

sku

The SKU (Stock Keeping Unit) of the ticket.

price

The listing price of the ticket.

Methods

getCpEditUrl()

Returns the URL to edit this ticket in the control panel.

getIsAvailable()

Returns whether this ticket is available for purchase. This is false when its event isn’t live, the ticket is disabled, the current time is outside its ticket type’s Available From and Available To dates, or it has sold out.

Read Session and Type Details

Use ticket.stock for the number of whole tickets available to purchase and ticket.remainingSeats for the number of seats remaining. They differ when a ticket admits more than one person. Capacity and purchased-seat counts continue to use seats.

A Ticket combines a session and a ticket type. Read the date from its session and the sale window from its type. For example, in a template where ticket is a Ticket returned by a ticket query:

{% if ticket.session %}
    <p>{{ ticket.session.startDate | date('medium') }}</p>
{% endif %}

{% if ticket.type and ticket.type.availableFrom %}
    <p>Available from {{ ticket.type.availableFrom | date('medium') }}</p>
{% endif %}

Use the cart or order line item for the quantity being purchased. A generated Ticket is the purchasable definition, not a customer's line-item quantity.