Ticketmatic’s widgets simplify setting up a more advanced ticket sales process that is better integrated in the website. Using widgets allows you to customize the ticket sales experience and interact with the website for a more integrated result. Widgets are managed by Ticketmatic and improve constantly.
If you don’t need this more advanced and integrated ticket sales process, consider using Plug and play ticket sales.
A widget is a configurable web application that covers a part of the ticket sales process. A typical ticket sales process consists of following steps:
- Explore events (happens on your website)
- Add tickets to order for an event
- Show basket (optional)
Widgets allow you to handle each of the steps 2 to 4 individually and allow you to navigate back to your website after each step. Compared to the plug and play approach which handles steps 2-4 in a single, straightforward wizard, this gives you much more flexibility to setup a ticket sales process that is tailored to your individual need.
Some examples of what you can achieve:
- You can let the user iterate between steps 1 and 2 to allow the user to add tickets for more than 1 event to his order
- You can provide your own upselling page, right before going to checkout
Widgets can be used
standalone. An embedded widget is displayed inside your website (using an iframe). A standalone widget is displayed in a complete browser window. Below you can experience how an embedded widget works.
Embedded widgets used inside an iframe require the use of a custom domain that is on the same domain as your website (for example
Generating a widget url
You use a widget by generating a widget url and simply linking to it.
When generating a widget url, you specify the parameters to configure the widget and then you need to generate a signature (to avoid tampering with the widget url). The easiest way to generate a widget url is by using one of the API libraries. Each library contains a helper class to generate widget urls and generating the signatures is provided by the library.
The signing helper is
Ticketmatic\Widgets. Instantiate it with your account name and widget keys:
1 use Ticketmatic\Widgets; 2 3 $widgets = new Widgets($accountname, $accesskey, $privatekey);
Pass a widget name and a set of parameters to sign the URL:
1 $url = $widgets->generateUrl("addtickets", array( 2 "event" => 123, 3 "skinid" => 1, 4 "returnurl" => "http://www.ticketmatic.com", 5 "l" => "en", 6 ));
If you don’t find a suitable library or if you prefer to generate the widget urls yourself you can manually generate widget urls.
You configure widgets by providing the parameters you want. Most parameters are optional, when omitting them Ticketmatic will provide sensible defaults.
You must specify the name of the widget. Ticketmatic provides following widgets:
Use this widget to add tickets for one or more events to an order. You can also use it to add products to an order.
You should at least specify the
- In the
eventparameter, specify one or more event ids (comma-separated) for which you want to sell tickets. Specifying multiple event ids works best when you have only a limited set of prices for each event. With too much prices, the widget quickly becomes too complicated. In that case it is best to use separate widgets for each event.
- In the
productparameter, specify one or more product ids.
The addtickets widget supports upselling: you can specify additional events and products beside the main event or product on sale. Use the parameters
extratickets and specify one or more ids.
Collecting ticket info
ticketinfo parameter to specify what information should be collected for each ticket that was added to the order. The ticketinfo parameter should contain a comma-separated list of fields. If this parameter is not specified, no extra ticket information will be collected.
Supported ticketinfo fields:
|name||Name of the ticket holder|
|E-mail address of the ticket holder|
Action after adding tickets
flow parameter to specify what should happen after adding tickets to the order:
|return||after adding tickets, go straight back to the website (parameter |
|checkout||after adding tickets, go straight to checkout (default)|
|basket||after adding tickets, go to the basket page. The basket page will contain an ‘Add more tickets’ link and the user will be redirected to the website when clicking this link (parameter |
|basketwithcheckout||after adding tickets, go to the basket page with possibility to continue to checkout. The basket page will contain an ‘Add more tickets’ link and the user will be redirected to the website when clicking this link (parameter |
Use this widget to display the contents of the current order to a user.
Disable editing the order
You can optionally disable the user to edit his order by specifying value
no for the parameter
edit. If this parameter is not specified, the order can be edited.
Action after displaying the order
flow parameter to specify what should happen after displaying the order:
|return||after displaying the order, go straight back to the website (parameter |
|checkout||display a |
Use this widget to handle checkout of an order: this means registering customer, payment and delivery info and handling the online payment.
Use the parameter
panels to specify what part of the checkout should be handled. The panels parameter should contain a comma-separated list of fields. If this parameter is not specified, all parts will be handled.
|delivery||Selection of delivery method|
|payment||Selection of payment method and handling online payment|
Action after checkout
oncompletion parameter to specify what should happen after the checkout:
|orderdetail||after a succesful checkout, go to the Ticketmatic order detail page|
|return||after a succesful checkout, go back to the website (parameter |
You can style widgets by styling the webskin. See the webskin article for more details.
You can define several webskins. Use the parameter
skinid to specify the webskin to use for the widget. If this parameter is not specified, the default webskin is used.
returnurl can be used on any widget. It should contain the landingpage on the website where the user will be redirected to after finishing the widget. When redirecting the user to the landingpage, Ticketmatic will add following parameters to the returnurl:
accesskey: the accesskey that was passed in the widget url
orderid: the orderid used or generated in the widget
contactid: the id of the authenticated contact
reason: the reason why the user was redirected (reservemoretickets, ordercompleted, ordercancelled, return)
signature: Ticketmatic generates a signature so you can verify that the call to the returnurl is genuine. The parameters are signed in exactly the same way as they need to be signed for the widget url
More advanced integration
For even more advanced integration, you can combine widgets with the API. For example: you could use the API to add tickets to the basket, and then use a checkout widget for letting the customer finish his order.