Skip to main content

Edit order mode

Configuration setting

mode: 'editOrder'

Description

Allows adding places to or removing places from an existing order. The places in the order can be specified through an order parameter.

If you pass in session="start", newly added places become temporarily held, so noone else can select them. Only start is supported as sessio parameter, not continue or manual. So unsaed changes are lost after a page reload.

There's no 'Apply changes' button, like in other event manager modes. Call chart.listOrderChanges() to get an overview of all changes made to the order, and use our API to change object statuses in batch.

Only popovers supported

You need to turn on the new popovers to see pricing when hovering an object.

Configuration

order

order: (string | SelectedAmount)[]

type SelectedAmount = {
label: string
ticketType?: string
amount?: number
}

The original order to edit. This can be

  • an array of object labels
  • an array of objects with label and ticketType properties for multi-level pricing
  • an array of objects with label and amount properties for areas
order: ['A-1', 'A-2']

order: [{label: 'A-1', ticketType: 'adult'}, {label: 'A-1', ticketType: 'child'}] // multi-level pricing

order: [{label: 'GA1', amount: 5}] // areas

Other configuration options

In addition, editOrder mode supports most of the configuration options of the Renderer:

And the following callbacks:

Additional methods for this mode

chart.listOrderChanges()

listOrderChanges(): Promise<OrderChange[]>

enum OrderChangeType {
PLACE_ADDED = 'PLACE_ADDED',
PLACE_REMOVED = 'PLACE_REMOVED',
TICKET_TYPE_CHANGED = 'TICKET_TYPE_CHANGED'
}

interface OrderChange {
type: OrderChangeType
object: string
ticketType?: string
}
const changes = await chart.listOrderChanges();
console.log(changes);
// [
// { "type": "PLACE_ADDED", "object": "A-1", "ticketType": "adult" },
// { "type": "TICKET_TYPE_CHANGED", "object": "A-2", "ticketType": "65+" },
// { "type": "PLACE_REMOVED", "object":"A-3" }
// ]

Returns an array of changes made to the order, such as added or removed places, or changed ticket types.

Each order change is an object with the following properties:

  • type: The type of change, one of PLACE_ADDED, PLACE_REMOVED, or TICKET_TYPE_CHANGED.
  • object: The label of the place that was added or removed, or the label of the place whose ticket type was changed.
  • ticketType: The ticket type that was added or changed. This property is only present if the change is of type TICKET_TYPE_CHANGED or PLACE_ADDED (and you're using multi-level pricing).