Events contain multiple tickets. When you're looping through available tickets using craft.events.tickets.eventId(event.id)
, you're actually working with a Events_TicketModel
. This in turn extends Commerce's Purchasable (opens new window) object.
Outputting a Events_TicketModel
object in your template without attaching a property or method will return the ticket’s name:
<h1>{{ ticket }}</h1>
Ticket Models have the following attributes and methods:
The ticket name/title.
The id of the ticket in the system.
Returns this ticket id - as ticket's are purchasables.
The ticket's Event Model.
The ticket's event Id
The ticket's event type.
The ticket's ticket type.
The ticket's ticket type Id
The sku of the ticket.
The quantity of the ticket.
The listing price of the ticket.
The date this ticket is available for sale.
The date this ticket will no longer be available for sale.
The tax category this voucher uses when their tax calculations are made.
The shipping category this voucher uses when their shipping calculations are made.
The url to edit this ticket.