Accessibility

My Tickets has been written to be as accessible as I can make it — it uses ARIA live regions to ensure that shopping cart feedback is immediately available to those who need it, uses solid, semantic HTML markup, and considers all the best practices for form labeling.

Accessibility is a priority for me, and is one of my primary focuses in development – but that doesn’t mean that I’ve caught every possible issue! If you find an accessibility issue, please do report it to me like any other issue – it’s a bug, and it needs to be fixed!

Add to cart forms

Add to Cart form example

The form to add an event to your cart can be automatically added to any My Calendar event or to any type of post or Page in WordPress. There are plugin settings that impact what will be shown, but in general it will include:

  1. A notice indicating any current restrictions. In the shown example, the event is happening too soon for tickets to be shipped by mail – when you’ve configured a number of days it general takes for tickets to be shipped by mail, that option will be automatically restricted if an event is happening too soon for the tickets to be shipped.
  2. The number of tickets remaining for the event.
  3. Fields to select the number of tickets for each ticket type, along with the price of that ticket. In this example, the tickets are being sold using “continuous” counting, so the number of tickets remaining is displayed above the ticket types. If this was being sold using “discrete” counting, the number of tickets remaining for each ticket type would be shown.
  4. An Add to Cart button

Alternate add to cart form, with discrete counting and single-purchase only.

When the event is added to the cart, a notice is displayed that indicates that the cart has been updated and providing a link to the shopping cart page for the user to complete their purchase.

Additionally, if you’re using the Quick Cart (which can be added to a theme filter, via a widget, or via the shortcode “[quick-cart]”), the number of tickets in the cart and the total price of those tickets will be updated at the same time.

The “Add to Cart” form is not the only way to add tickets to a cart. You can also add tickets to a cart using a link. The format for an add to cart link is /cart_page/?mt_add_to_cart=true&event_id=POSTID&ticket_type=TYPE&count=COUNT.

Try it: Add 2 adult tickets to demo event.

Adding a new ticket order

If you’re running a box office using any piece of software, it’s important that you’re able to add sales from the back-end. Using My Tickets, there are a number of ways to add new ticket orders as an administrator. You can only process payments by going through the public shopping cart, but if you have any other means to accept payments – cash, check, credit card terminal, Square Register, etc., then you can set up a ticket order and process that payment without going through that process.

New payments are added from the WordPress dashboard by going to the “Payments” menu item.

Payments Menu item

Go to “Payments” > “Add New”. If you don’t have a shopping cart set up, you’ll see the message “Visit the public web site to set up a cart order”. This isn’t because you need to go through the front-end to create a purchase; it’s because you need to add items to the shopping cart. If you have an active shopping cart on the front-end, you’ll have access to that shopping cart from the admin panel as well.

You can edit the contents of the shopping cart in the front-end as long as you haven’t saved the payment in the admin – once the payment is saved in the admin, the contents are locked.

Visit the public web site to set up a cart order.

As soon as you set up a shopping cart on the front-end, however, you’ll see that in the add payment form:

Cart item added

You’re not restricted to setting up payments using just your cart. If a user creates a cart while logged-in, you can copy that user’s shopping cart from their user profile into the admin panel.

Navigate to the User’s profile at Users > All Users and open their profile to edit.

edit-user

Generally, the user’s shopping cart will be visible towards the bottom of the profile screen. However, this can vary depending on what other plug-ins you have installed.

Shopping cart in user profile.

From the user profile, you can simply click the link “Create new payment with this cart” to copy the cart into a new payment.

If the user isn’t logged in, the process is a bit more labored, but it’s still possible. For users who aren’t logged-in, My Tickets inserts a meta field into the site header with a unique cart ID. You can ask users to view the source of the page to retrieve their cart ID (there’s no way to obtain this information without the purchaser providing it to you). The ID should appear very near the top of the source code, and look like this:

<meta name='cart_id' value='HXKFiBbmm00JfaAT' />

Once you’ve retrieved that cart ID, you can use it as a parameter to add a payment for the cart:

http://www.example.com/wp-admin/post-new.php?post_type=mt-payments&cart_id=HXKFiBbmm00JfaAT

At that point, you can submit their purchase to the system. This is a convenient way of handling ticket sales problems by phone or at your box office while keeping all of your ticket sales within a single system.

Filling in the admin payments form is a simple process, with relatively few fields. You must specify a payment status and ticketing method, and you’re recommend to provide all other data.

You can’t specify a user as “Do not email” at the time of data entry, because the system needs to be able to send at minimum the receipt and purchase notification emails. However, all subsequent email messages sent to the user using the “Contact Purchaser” forms will include a link for the user to remove themselves from your mailing list, and this data will appear in their purchase record. If they make a future purchase, they will still receive the basic purchase notification, however, as this type of contact is a fundamental business need.

Custom CSS

My Tickets provides relatively sparse default styles. These styles are intended to do the minimum necessary to make My Tickets usable, and reasonably attractive as long as the theme doesn’t impose too many changes.

My Tickets is intended to be customized. You can add your own styles through your theme, but it’s also very easy to override all of My Tickets default CSS. If you add a stylesheet called ‘mt-cart.css’ into a directory in your theme called ‘css’, that stylesheet will be used in place of the default My Tickets stylesheet.

Because the CSS used by My Tickets is designed to be overridden, there’s a very good chance that much of the styles will be overridden by various characteristics of your theme. This is intentional, to keep My Tickets light-weight and easy to modify, but does have consequences if you don’t have the knowledge or experience to customize stylesheets.

Customizing CSS is outside what is provided as support for My Tickets, but if you need assistance, you can submit a support request to hire Joe Dolson Accessible Web Design for customization tasks or to point you towards a developer who can help you.

Custom Field API

If you’re selling tickets, it’s not uncommon that you’ll need to gather some form of custom information. Do you need your customers to check a box verifying that they’re over 18? Do you need to get a phone number for each event? Find out which meal a customer would prefer for lunch?

My Tickets supports a custom field API that can add a custom field into the “Add to Cart” form. What it does is largely up to you; but it’s very easy to write a basic extension to collect custom data for an event.

Custom fields are added using the filter ‘mt_custom_fields‘.

In the filter, all you need to do is add an array of data to the custom fields array that passes the label for your custom field, a sanitization callback function, a display callback function, an input type, a set of values to choose from, and a context.

Any of these values can be omitted except for the label.

If you only provide a label, you will create a text input field with no default value. It’ll be sanitized using esc_sql and strip_tags. The display callback will call esc_attr and stripslashes on the value for display. When you create a callback, your callback gets two arguments: the data value itself, and the context it’s shown in. That will either by ‘cart’, for the shopping cart or add to cart context, or ‘payment’, if it’s being shown in the admin.

Supported input types include all the basic inputs, but do not currently include an upload field or other media selection method.

The context for the field defaults to ‘global’, but you can also pass a specific event ID or an array of event IDs. This rule defines where the custom field will show up – with ‘global’, it’ll show up on all add to cart forms. To create custom rules for displaying custom fields, use the ‘mt_apply_custom_field_rules‘ filter.

Example Implementation

add_filter( 'mt_custom_fields', 'create_custom_fields', 10, 1 );
function create_custom_fields( $array ) {
	// Other fields: sanitize callback; input type; input values; display_callback
	$array['test_event_data'] = array( 
		'title'=>"Meal preference", 
		'sanitize_callback'=>'sanitize_callback', 
		'display_callback'=>'display_callback',
		'input_type'=>'select',
		'input_values'=>array( 'Chicken', 'Salad', 'Doughnut' ),
		'context'=> 'global'
	);
	return $array;
}

/* Display callback formats the saved data. $context is 'payment' or 'cart', depending on whether it appears in an admin payment or the user's shopping cart. */
function display_callback( $data, $context='payment' ) {
	return urldecode( $data );
}

/* Sanitize callback cleans the data before saving to the DB */
function sanitize_callback( $data ) {
	return esc_sql( $data );
}

Adding a custom field will also automatically add this data into the Payments reports and will create a template tag so you can use the custom field in your automatic response emails.

Custom post types

In any post type that you’re allowing to be used to sell tickets for events, you’ll have a section labeled “My Tickets Purchase Data” in a metabox for that post type. By default, it should appear underneath your main content area; although it’s impossible to control exactly where it will sit on that screen from a plug-in.

Sell tickets on this post

When you click on the checkbox to have sales on this post, the full set of sales options will open:

Define ticket sales form

This form differs only slightly from what you get when using My Calendar, because in My Calendar the date, time, and location information is pulled from the event. When creating a ticketed event from a post type, however, you need to define that information here.

It is possible to display the event date and time for a custom post type, since they’re saved in standard custom post fields. You can do that using My Tickets by using the simple shortcode [ticket_data type=’date’]. It accepts three values: date, time, and location, depending on what you choose to display.

Location is only available by default if you also have My Calendar installed; it pulls locations from the My Calendar Locations database table. You don’t need to be using My Calendar to take advantage of this, other than as a means to store your location data.

For advanced users, you can also write a custom function to map another set of location data into a format that My Tickets will understand using the ‘mt_create_location_object’ filter, and define a function called ‘mc_location_select’ that provides the dropdown menu to choose your locations.

The other options for creating events are as follows:

  • Allow sales until x hours before the event – Set an amount of time prior to the event when you no longer want sales to be possible. It’s always possible to add another sale when you’re logged in as an administrator.
  • Allow multiple tickets/ticket type per purchaser – Purchasers can buy multiple tickets for an event – (e.g. 2 adult tickets and one child) in a single cart purchase. If disabled, purchasers can buy only one ticket for an event. Instead of a text input to choose a number of events, they will see a checkbox to select a ticket.
  • Total Tickets Available – For “continuous” purchase types, this is the total number of tickets available.
  • Ticket Prices and Availability – Shows the labels and prices as well as the number of tickets sold. For tickets using “discrete” counting, the number of tickets available will be a text field and the “Total Tickets Available” field will not be displayed.
  • Type of Sale – This simply toggles the language in use for add to cart forms. E.g. “Buy a Ticket” vs. “Register”
  • Ticket Counting Method – Effects whether tickets are counted as a single total or per section.
  • Don’t display form on event – You can use the ‘ticket’ shortcode to customize where your order form is displayed. If you’re using this in the event post, you may no also want to see the default form.

Discounts

Purchase My Tickets: Discounts to support the creation and acceptance of discount codes. With this add-on, you can create custom discount codes to use in promoting your events and providing segmented discounts to groups of your customers.

Discount codes are added to the bottom of the shopping cart, and can be applied, removed, and updated. Codes are not case-sensitive, to ensure that they’re easy for your users to enter correctly.

Donations

Purchase My Tickets: Donations to allow ticket purchaser to make a donation while they purchase their tickets. If you’re operating a non-profit organization, event tickets are rarely enough to cover your events on their own; providing the option for users to add a donation to their purchase without requiring a separate checkout process can help improve your bottom line.

Editing payments

All payments can be edited after purchase. Not all fields are editable; you can’t change the tickets purchased, total cost, or transaction data, although you can add internal notes if you need to have a record of some issue handled in the purchase. Internal notes are never used on the front-end by My Tickets, and shouldn’t ever be displayed by any custom add-ons you use.

The most common reason for editing payments may be in handling Pending payments where payment has been received; if you’re tracking specific transaction IDs such as check numbers (If you’re tracking credit card numbers, you should stop immediately – this is a major security problem!), you’ll need to edit each payment individually, but if all you really need to do is mark a bunch of pending posts as completed, you can bulk edit payments to adjust this.

bulk-edit

If a user doesn’t receive their email notification, you can re-send it by checking the box labeled “Re-send Email Notification”.

Additionally, you can send specific purchasers a personal email from their payments page. Some venues will probably rarely need this, but for events that need to verify information with the purchaser, this can be very useful.

editing-payment

If you need to mass email all the purchasers of tickets for a particular event (for example, if the event had to be cancelled or delayed), you can do the from the Reports screen.

Main Settings

The main settings page for My Tickets is where you:

  • set your license key, entitling you to support and updates
  • determine whether to send email as HTML or plain text
  • designate the recipient of administrative email notifications and the sending address for notifications sent to purchasers
  • Write your notification messages for both administrators and purchaser
  • Determine which post types you would like to use for ticketing

The most significant section of this is the email notifications, which has it’s own article in this documentation. Otherwise, you need to know that you only need the license key in order to be eligible for support and updates (no support of any kind is provided without a license key).

My Tickets will work with any public post type, but the user interface for setting up your tickets is added as a meta box in the post editor administration. If you have a public post type that uses a custom interface, there’s no guarantee that you’ll be able to set up tickets for that post type.

Mass Email purchasers

It’s sometimes necessary to send an email to everybody who’s purchased a ticket for a particular event. Maybe it’s because there’s a last minute venue change, a cancellation, or a time change – whatever the reason, it’s valuable to be able to send a quick message to everybody coming to an event.

Send Mass Email form

For the most reliable delivery, you should generally use a mailing service like MailChimp or My Emma, but My Tickets will do the job for reasonable numbers of purchasers.

The interface for mass emailing purchasers can be found on the Reports screen in your WordPress dashboard. By default, the message will be sent in HTML format, so you can use HTML in your message.

My Tickets doesn’t provide a direct mechanism to add a header or footer to your message, but it does provide a filter (mt_modify_email_body) that you can use to mass modify all email messages sent by My Tickets. This filter is applied to all email messages sent in any context by My Tickets, so you should take that into consideration when you write filters for these messages. The filter does receive one argument other than the message body, which is a variable indicating whether the message is sent to an admin or a purchaser.

Notification Messages

Notification messages support twelve default template tags to provide information to your purchasers and administrators. You can add additional notification messages by using the My Tickets custom field api.

The content produced by some of these tags is simple strings, but others produce more complicated data. All of the tags automatically toggle their formats depending on whether you’re sending HTML or plaintext email.

{receipt}
A link to the user’s receipt.
{tickets}
For e-tickets or printable tickets, a list of the purchased tickets.
{name}
The purchaser’s name, as provided in the shopping cart.
{blogname}
The name of your site.
{key}
The purchase’s internal payment ID. (Probably only useful for admin messages!)
{purchase}
Purchase data: tickets purchased, how many, at what price.
{address}
The purchaser’s provided shipping address.
{transaction}
All transaction data from the payment gateway.
{transaction_id}
The payment gateway’s transaction ID.
{amount_due}
For offline payments, the amount owed on the purchase.
{method}
The ticketing method chosen by the purchaser.

In general, I recommended that you at minimum provide your purchaser’s with their receipt link and their purchase data, regardless of the ticketing and payment methods you allow.

Notifications

There are three cases where email notifications can be sent for any purchase: successful purchases, failed purchases, and refunded purchases. Refunds can only be processed from the payment gateway at this time; there’s no mechanism to refund a purchase from within My Tickets. You’ll need to login to your payment processor to post a refund.

In all cases, an email will be sent both to the administrative recipient and to the purchaser. All messages can be customized, and can be sent either as plain text or as HTML. By default, they’re sent as very simple HTML.

For offline payments, the “Completed” message will actually be sent immediately, without waiting for payment. In the administration, the payment will be marked as “Pending” until you manually mark it as received. At that time, the purchaser will receive a second notification indicating that their payment is completed.

Ticket IDs are not generated until the payment is completed, so for any payment that hasn’t been completed, no tickets will exist.

Payment process

The payment form re-confirms the shopping cart, but without the options to change the number of tickets or remove a ticket. The payment fields required can vary widely; if the shipping option is enabled, the purchaser’s address will be required. Authorize.net will request the usual credit card information, etc.

Credit card numbers are never saved to your site by any payment gateway developed by or sold by Joe Dolson Accessible Web Design; but I can’t make guarantees about any payment gateways you have custom developed or purchase elsewhere.

Example of Payment Form

Payment Settings

Payment settings cover all the settings directly related to making payments, unsurprisingly. My Tickets supports offline payment and PayPal standard out of the box. Other gateways are available for purchase.

Before you can accept payments, you need to set the currency you want to use for selling tickets. You can also define a percentage discount available to logged-in members. Right now, My Tickets doesn’t support any other discount or sales methods.

By default, the offline payment gateway is the only configured option. Using this option, tickets will not be created until you manually mark the payment as completed in the Payments management screen. You can do this prior to receiving the payment if you wish, but you’ll have to take responsibility for making certain that your notification messages reflect the fact that payments have not actually been made!

gateways

Authorize.net and PayPal settings are the usual basic configuration for these gateways; look at the Ticketing Help screen to get more information about where to get your information for these gateways if you don’t know. You’ll have to have a PayPal or Authorize.net account to use them.

You can enable Testing mode during development. In this mode, Authorize.net queries will be made against the Authorize.net developer’s sandbox. You can get a free account for the Authorize.net sandbox so that you can verify that everything works before going live. You can also use the PayPal developer sandbox to work with PayPal.

While your site is in test mode, a banner will be displayed at the bottom of your site indicating that the site is in test mode and that payments will not be processed.

If you have an SSL certificate for your site (and I recommend that you do), you can enable SSL for payment pages, and My Tickets will attempt to force SSL for those pages. There are many factors that can prevent a page from properly rendering securely, and My Tickets can’t guarantee this – it’s your responsibility to ensure that your site is secure. An SSL certificate is not required for My Tickets to operate, but is strongly recommended.

ticket-pages

Finally, you can set the payment and other rendering pages for your cart. There are three dedicated pages created by My Tickets – one each for your Shopping cart, your tickets page, and your receipts page. The shopping cart will use your standard theme template, and you can edit it just like you would any other page. The tickets and receipts page will automatically use custom templates provided by My Tickets. If you copy the /wp-content/plugins/my-tickets/templates/ directory into your theme directory, you can customize those templates. The copy in your theme directory will be used instead of the default templates. You don’t need to copy the entire directory; only the parts you intend to replace.

Payments List

The payments list (WordPress Dashboard > Payments) is a pretty straightforward custom post type screen with a few key changes.

First, the screen includes the status of the payment, the total value of that shopping cart, and the receipt ID for the cart. Receipt IDs are generated very early on in the process, so even unsubmitted carts will have a receipt ID assigned already.

Carts that have been created but not submitted for payment will be labeled as “Active Cart” in the list. These will usually linger until they’re completed; My Tickets doesn’t currently automatically clear out old data. However, all active carts also have the “draft” post status, so you can view a list of all active carts by viewing the draft payments.

Display of payments screen.

Payments can have one of four statuses: Completed, for payments that are paid and processed; Pending, for payments still awaiting payment, Failed for any payments where the payment was attempted, but failed, and Refunded, if you’ve refunded the payment.

You can filter the screen to show only payments with one of these statuses, for easier navigation. If you have a large volume of pending payments to mark as completed, you can do that as a bulk action.

Printable and E-tickets

A printable ticket

Printable and E-tickets are fundamentally the same, but the templates are substantially different; e-tickets are designed for use on a mobile device, in particular. Both types of tickets use QR codes for validation, and you can use any QR scanning device (mobile phone app, iPad, etc.) to scan the QR code and go to the validation URL for that ticket.

If you want the ticket to be marked internally as used, you’ll need to be logged in within your QR scanning device. Many QR code scanning applications provide the ability to open the scanned URL in a browser of your choice, but this is not available in all applications. I’ve had success using the Scan.me app for iOS and Android.

Ticket verified on a mobile device.The validation URL for the ticket will show the name, date, and time of the event, so you can verify that the ticket is for the current event. It will also indicate whether the ticket is verified; if it is, it will show a message saying “Ticket Verified“.

If the ticket is a valid ticket, but has already been checked by a ticket taker who is logged-in to the site and has the ‘mt-verify-ticket’ capability, the message will also indicate that the ticket has been used. Tickets are only registered as having been used if the ticket taker is logged-into your web site and has the correct permissions. By default, only administrators have the capability, but you can assign it to any user.

You can assign capabilities on a user-by-user basis in their user profiles. Only administrators can assign capabilities.

If the ticket ID was not valid, the message displayed will be “Not a valid ticket ID“.

You can customize the tickets using standard WordPress templating methods. My Tickets load a template called ‘tickets.php’ for use as the tickets template; if you place a file by that name in your theme directory, that template will be used in place of My Ticket’s default template.

Quick Cart

The “Quick Cart” shows the number of tickets currently in a visitor’s shopping cart and the total price of their cart, with a link to check out. By default, it looks like this:

In your cart: 7 tickets | $56.00 | Checkout

Like everything else in My Tickets, the default CSS is very spartan, to allow you to customize easily, without needing to override existing styles. The HTML, however, has many available hooks for you to use for your own design needs.

<div class='mt-quick-cart' aria-live='polite'>In your cart: <span class='mt_qc_tickets'>7</span> tickets
	<span class='divider'>|</span> 
	<span class='mt_currency'>$</span><span class='mt_qc_total'>56.00</span>
	<span class='divider'>|</span> 
	<a href="http://docs.joedolson.com/purchase/">Checkout</a>
</div>

Quick Start Guide

To start using My Tickets, follow these steps:

  1. Do you create a new Page for events? Then you’ll want to sell Tickets on Pages. Go to My Tickets > Settings. Check off ‘Pages’ in the check boxes for available post types. My Tickets supports any post type, but is not enabled by default.
  2. Go to My Tickets > Payment Settings. If you want to collect payment when ticket holders arrive at your event, you can leave the ‘Offline’ payment gateway enabled. You’ll need to collect payments when your guests arrive. To collect payment automatically, you’ll need to enable another gateway and enter your payment information for that gateway. PayPal Standard is available with the free plug-in, or purchase premium gateways for Stripe and Authorize.net.
  3. Enable “Testing mode” at My Tickets > Payment Settings to run transactions without processing payments.
  4. Go to Pages > Add New and add a new Page for your event. On that page, check the box labeled “Sell Tickets on this post.”
  5. Fill in the fields for your event. The defaults that are set up from the beginning are set at My Tickets > Ticket Settings. Those defaults are useful if most of your events use the same settings, but you can customize them on every event. Tickets won’t be available for sale unless:
    • there’s an event date and time set,
    • a specific number of tickets available,
    • and a price set for at least one type of ticket.
  6. You’ll notice an option for Complimentary tickets. These tickets aren’t available for most users – only users with permissions to manage the box office (administrators, by default) are able to see complimentary ticketing.
  7. View your newly saved page. You should see a panel to add tickets to your cart. Add some tickets to your cart.
  8. Follow the link to go view your cart. If you’re logged in as an administrator, you’ll have two options from here: you can either proceed through the purchase process, or you can click through and generate a new payment with the information in that cart. That’s also an option only available to box office managers, which gives you the ability to easily add sales that you take over the phone or in person at your box office facility, if you have one.

When a purchaser makes a purchase, a Payment is created in the back-end. It is marked as ‘Pending’ until payment is completed. With offline payments, you’ll always need to mark the payments as completed manually, when you receive payment. With online payments, they should be marked as completed as soon as the payment finishes processing. That’s usually very close to instantaneously, unless a Paypal payment is accepted that’s using an eCheck. In that case, it could take 3-7 days to complete.

Receipts

receiptImmediately following a completed cart submission, purchaser will receive a notification from your web site about their purchase. The information included in that notification email is set in settings, but it should always include a link to the purchase receipt.

Purchases that were made using an off-line payment type will still receive a receipt link, but in the ‘Payment’ section of the receipt, it will indicate that the payment has not yet been completed. Once you mark the purchase as Completed in the Payments section of the WordPress admin, the receipt will include those payment details.

The text “Add your business name and address to the post content” is customized by editing the WordPress Page My Tickets creates for your receipts. This is recommend content, standard for a receipt; but you can add any information you need onto your receipts.

Receipts can be extensively customized using theme template files. The templating in My Tickets includes a library of templating functions that you can use in your receipt or ticket templates.

Reporting

My Tickets offers a variety of basic reports. You can generate reports of sales by date, retrieving all sales occurring between the two selected dates or reports of sales by event, retrieving all sales on that event.

Forms to select available reports.

Additionally, you can generate a list of tickets sold for an event. This is different from the list of purchases, in that it will list all of the ticket IDs that are valid for a given event, with the name of the purchaser, purchase ID, and ticket price. In the HTML view, it will provide a link to edit the associated purchase record, as well.

By default, when you enter the reporting page, it’ll show you a list of all sales within the last 7 days. If you’re running a high volume ticketing site, where this is too long of a list for comfort, you can use the filter ‘mt_default_report_start_date’ to pass a custom string formatted date argument and change the amount of data shown.

You can either view reports as HTML on your screen or export them as CSV formatted files. The two reports are fundamentally identical, except that the CSV formatted export splits the purchaser’s name into separate first and last name fields, for easier sorting.

The payment report includes first name, last name, ticket type purchased (e.g., Adult, Child, etc.), the number of tickets purchased, the price per ticket, the total amount paid for those tickets, the current payment status, the purchase date, and the purchase time.

For any purchaser who purchased more than one type of ticket – for example, a purchaser who bought tickets for two adults and one child, their name will appear on the list twice, once for each type of ticket purchased.

Script Resources

My Tickets enqueues a small number of useful scripts you can take advantage of in your theme or custom extension to My Tickets. One that’s particular useful if you’re writing a custom payment gateway is jQuery Payments, the jQuery plug-in by Stripe for validating and handling credit card payment information.

Additionally, the AJAX actions used by My Tickets to add, remove, and update the shopping cart have hooks usable to handle custom actions during shopping cart updates. See the filters and actions reference for more assistance with My Tickets’ filters and actions.

Shopping Cart

The shopping cart shows a variety of information about the events, including the title, date, and time. If the event came from My Calendar, it’s not always possible to provide a link back to the event, in which case the title will be unlinked. For posts and post types, there will always be a link back to the post permalink with the title.

Events that have featured images will also include the image for that event in the shopping cart.

At the first stage of the shopping cart, purchasers need to add their name, email address, ticket type, and choose their preferred payment gateway. If only one payment gateway is configured, the cart will automatically be set to that gateway.

Simple gateways (like the provided PayPal standard gateway) don’t require any additional name or email information; gateways that do require that information will have it automatically entered from the previous fields, so users don’t need to enter the information twice.

All tickets in a given cart need to use the same type of ticket.

Shopping Cart example

Shortcodes

There are two key shortcodes available for My Tickets. There’s a basic shortcode to display the ‘Add to Cart’ form for a single event:


[ticket event='{ID}']

This shortcode is displayed in the settings when you create a ticketed event, and you can paste it anywhere to render an add to cart form for that event. You don’t need to use it on the event page itself, although you certainly can.

The second shortcode is for displaying a collection of tickets:


[tickets events='14,29,38' template='<h3>{post_title}: {event_begin format="l, F d"}</h3><p>{post_excerpt}</p>']

This shortcode will render the add to cart forms for the IDs provided, using the template provided. The example above is the default, and is what you’ll see if you don’t use the template attribute. The registration form itself will appear after the templated data. The entire output will be wrapped in a div element with the class mt-event-item.

Stripe

Purchase My Tickets: Stripe to use the easy and secure payment gateway as a way for your visitors to use their credit card and make purchases. Stripe is a great platform for handling payments, and is (relatively) easy to set up.

(Hey, it’s a payment gateway. None of them are actually easy.)

Templating

There are four areas of My Tickets that are templatable:

  • receipts,
  • tickets,
  • the opt-out form for email notifications,
  • and the ticket verification screen used by ticket-takers.

Templates can be customized in the standard WordPress way: take a copy of the file from wp-content/plugins/my-tickets/templates/, place it at the root of your theme directory, and edit it until it does what you want.

By default, the templates load their CSS within the template, and you can modify CSS directly within your template or load external styles.

All My Tickets specific templating functions are in the file my-tickets/mt-templating.php. All functions prefixed with `mt_get_` will `return` the data for manipulation in PHP; all functions without `get_` will `echo` the result.

Ticket Settings

In the ticket settings, you configure what types of tickets you want to support and the default values new events should use.

Types of Tickets

My Tickets supports 4 types of tickets: Printable, E-tickets, Postal Mail, and Pick up at box office (or “Will call”). On this page, you can define which of these formats you want to make available for sale. Printable and e-tickets have QR code-based validation systems; postal mail and will-call systems assume that you will produce your tickets independently of the My Tickets system, although you can produce lists of purchases using the My Tickets Reports panel.

Ticket Shipping

If you’re offering tickets available via postal mail, you need to set a shipping cost and an approximate shipping time for postal mail. The shipping cost is added to shopping carts if the selected ticketing method is postal mail. This is a flat fee; it doesn’t matter whether somebody has purchased 1 ticket or 200.

The shipping time is used to notify the purchaser of the approximate time until they’ll receive their ticket, but is also used internally to prevent purchasers from choosing the postal mail option if the time until the event will not allow them to receive their tickets. If you indicate that it usually takes 5 days for a purchaser to receive their ticket, then that options will cease to be available for an event 5 days prior to the event.

In addition to setting a shipping & handling charge that’s based on the entire cart, you can set a per-ticket handling charge. This can be valuable if you need to separate out secondary costs for the tickets that are common to all tickets, rather than wrapping them into the cost.

Closing Sales on Tickets

Close by time
You can set a number of hours prior to an event when tickets may no longer be sold for an event. For example, if you need to collate your list to prep for an event starting 4 hours before the event, you can shut off online sales 4 hours before the event. This will happen automatically, so you don’t have to worry about unexpected last minute sales.

Close by number of tickets remaining
If you want to reserve a certain number of tickets for sale at the venue, you can specify either a specific number of tickets to reserve for all events or a specific percentage of the total available tickets to reserve. Once the number of tickets falls below that point, online sales will be closed. Visitors to your site will get a notification telling them that online sales are closed and how many tickets are still available at the box office.

Can users purchase multiple tickets?

You can set an event to allow multiple tickets for each event per purchaser or only a single ticket. This can particularly be useful in combination with My Tickets custom field api. Allowing multiple tickets is the norm, in which case the purchaser can buy any number of tickets for the event; if it’s restricted to single tickets, the user will not have any of the options to adjust the number of tickets for a particular event, and will only be able to choose one.

How are tickets counted?

Total tickets available is the number of tickets available when using “continuous” ticket counting. If the counting method is “discrete”, this field will not be displayed. You would use “continuous” counting methods when it doesn’t matter which type of ticket a user buys – for example, when you’re selling tickets for Adults, Children, and Seniors. You could equally well sell out to all seniors or all adults. If you’re selling by section, however, (Main Floor, Balcony, Gallery), then it does matter which type of ticket a user buys, and you’ll want to use “discrete” counting, so that you can only sell a finite number of tickets for each section.

You can customize the price groups you use as a default. This can save a lot of time if you’re selling the same types of tickets over and over again.

The Type of Sale is mostly about the language used – whether a user is “Buying a ticket” or “Registering for an event”.

And I’ve already talked about counting methods. 🙂

General Admissions Tickets

Since My Tickets version 1.9, you can sell tickets for events that don’t have any fixed date. These are described as ‘General Admission’ tickets in the ticket settings. These tickets will be good for admission for a particularly amount of time after purchase. This type of ticket is good for admission to experiences such as a sight-seeing destination, museum, or gallery, where the experience is available every day, and time-specific admissions aren’t required.

Ticket Types

Shows the select menu for choosing ticket types.My Tickets supports four types of tickets: e-tickets, printable, will call, and postal, to try and best integrate with your event work flow. The type of ticket purchased is determined at the time of payment, so it’s not possible to mix and match events and ticket types: all events need to be sold with the same available types of ticketing.

E-tickets are intended to be presented at the event using a mobile device. You can use your own mobile phone with any QR code reader to scan the ticket and verify it.

Printable tickets are the same as e-tickets, except that they’re designed to be printed. You can also scan the QR code on a printable ticket to verify it.

Will Call assumes that you produce your tickets as a separate process, and will simply produce a report of purchasers to check against and prepare tickets for pick-up. You can produce a list of ticket purchasers and the tickets they purchased from the reporting tab in the My Tickets settings.

Postal tickets assume that you will print a ticket for the purchaser and ship it to them. My Tickets allows you to set a single price for shipping that will be added to an order; it doesn’t provide any method to automatically produce shipping costs. As an administrator, you’ll have access to view the printable ticket for any purchaser, so you can use that to print a ticket if you wish, or produce tickets using a completely independent process.

You can enable any combination of tickets and the purchaser choose the type of ticket they want to purchase.

E-tickets and printable tickets can be extensively customized using theme template files. The templating in My Tickets includes a library of templating functions that you can use in your ticket templates.

Using in My Calendar

Using My Tickets integrated into My Calendar is almost identical to using it with a custom post type, except that the event date, event time, and location data is pulled from your My Calendar event instead of from the post.

My Tickets and Recurring Events

At this time, I don’t recommend that you use My Tickets to sell tickets on recurring or grouped events in My Calendar; the way My Tickets handles event data is not compatible with complex events.

For singular events, it’s very straightforward.

When My Tickets is installed, it will replace the default ‘Registration’ section in your My Calendar Events Manager with the ticketing set up form (as documented in the custom post types form.)

I can’t see how to sell tickets from My Calendar!

It’s possible that you won’t be able to see this form when you first install My Tickets with My Calendar. My Calendar includes options to disable the registration input fields on both a global and an individual level, which can mean that these fields are hidden. If you can’t find the registration information panel under My Calendar > Add Events, there are two places to check.

  1. My Calendar > Settings > Input Settings Make sure that the “Registration” options are enabled for input.
  2. My Calendar > Add Event > Screen Options (Screen options are found in the top right corner of the screen.) Make sure that the registration input options are enabled for you, personally.

The add to cart form is automatically added to your standard details pop-up when viewing My Calendar in either List or Grid mode, and can also be added to Upcoming Events lists or any other custom template using the template tag {register}.

Waiting List

You’re busily selling tickets for your event, and – bang! You’re all sold out! That’s awesome. But we all know that things change! People cancel their tickets, they want to change to another date, and suddenly your sold out event has 10 spots available. With the My Tickets Waiting List extension, as soon as your event sells out, the form is automatically converted over to start a waiting list for your event.

Will-call lists

If you’re selling tickets by multiple methods, or you like to offer the option to your attendees to simply be checked off on a list or pick up their tickets at the event, then you’ll find a will-call list to be valuable.

My Tickets can produce two different types of will-call lists, both produced by the My Tickets “Reports” screen. The first list is a list of ticket purchasers. This list shows each person who has purchased tickets, along with the types and number of tickets they purchased. If they purchased two different types of tickets (Adult and Child, for example), then they will appear on the list twice, once for each type of ticket.

The second type of will-call list is a list of tickets. This list will show all tickets registered for this event, with the purchaser name, purchase ID, ticket type and ticket price. In this case, the purchaser’s name will appear on the list as many times as the number of tickets they purchased – if they purchased 8 tickets, they will appear on the list 8 times.

Which list is best for you really depends on how your purchasers tend to buy tickets, and which type of event you run.