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.)

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.

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.

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.

Quick Start Guide

To start using My Tickets, follow these steps:

  1. Figure out how you want to promote your events. Do you create a new Page for events? Then you’ll want to sell Tickets on Pages. Go to My Tickets > Settings. Scroll to the bottom and select ‘Pages’ from the list of available post types.
  2. Go to My Tickets > Payment Settings. If you intend 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. If you want 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.
  3. Enable the “Testing mode” on the same page if you want to run transactions without actually 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 these.
  7. Go to 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 will be created in the back-end. It’ll be marked as ‘Pending’ until a 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.

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!

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>

Templating

There are four key sections of My Tickets that are templatable: receipts, tickets, the opt-out form for email notifications, and the ticket verification screen used by ticket-takers. They’re all templatable 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 enqueue their own custom CSS. This CSS is added using the plugin URL, so if you have copied the template into your theme directory, it won’t be automatically accessing the right URL. In the file, find <?php echo plugins_url( 'css/generic.css', __FILE__ ); ?> and <?php echo plugins_url( 'css/ticket.css', __FILE__ ); ?>. Change those to <?php echo plugin_dir_url( 'my-tickets/css/generic.css', __FILE__ ); ?> and <?php echo plugin_dir_url( 'my-tickets/css/generic.css', __FILE__ ); ?>.

You can use that CSS and extend it, or create your own; there are no limitations – the templates include their own CSS, so you simply edit the template to include something different, if that’s what you want.

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.