iticket-seatingplan
v1.0.19
Published
Seating plan with FLEXi pricing
Downloads
24
Readme
iticket-seatingplan docs
Installing the package:
npm install iticket-seatingplan
Importing SeatingPlan module in your component:
import { SeatingPlan } from 'iticket-seatingplan'
Using the SeatingPlan component
<SeatingPlan
eventId={eventId}
showingUid={showingUid}
sessionId={sessionId}
showingId={showingId}
priceAgeId={priceAgeId}
quantity={quantity}
price={price}
callbackFunction={callbackFunction}
apiKey={apiKey}
/>
SeatingPlan
| Prop | Type | Description | | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | eventId | integer | eventId of event.required | | showingUid | string | showingUid of the selected showing.required | | showingId | integer | showingId of the selected showing.required | | sessionId | string | sessionId from the initial CreateBasket endpoint.required | | priceAgeId | integer | priceAgeId selected by user.required | | quantity | integer | quantity specified by user.required | | price | float | price specified by user if it is dynamically priced. Must be >= priceMinimum and <= priceMaximum. If not supplied, default price will be applied.optional | | apiKey | string | API key provided by iTICKET.required | | callbackFunction | function | callbackFunction to listen for SeatingPlan events.required |
callbackFunction
This function will be triggered any time there is an update to the basket or an error has occurred. Below is a sample callbackFunction that just console.logs
an event:
const callbackFunction = (e) => {
console.log('event', e)
}
Sample callback results are as follows:
A seat has been added to cart:
{ "type":"cart-change", "details":[ { "showingSeatId":4158647, "showingId": 84164, "rowName":"I", "columnName":"13", "price": 51, "priceAgeName": "ADULT", } ] }
An error has occurred, *e.g. price specified is greater than or less than the set priceMinimum and/or priceMaximum*
{ "type":"error", "details":{ "error":{ "code":403, "message":"Price specified not allowed." } } }