When you sell tickets with Tickets Plus and WooCommerce, each individual ticket is actually a fully-fledged WooCommerce product.

However, to provide a nice, smooth experience for your customers we do not normally let them view the actual WooCommerce-generated product page. Instead, they choose the number of tickets they wish to have from right on the event page and then proceed straight to the cart/checkout screens.

That’s not always desirable – you might wish to make use of a WooCommerce add-on (or even a built-in feature) that only swings into effect in the context of the actual WooCommerce product page. The good news is that you can set things up so customers can view that page and order tickets from there.

First, you need to allow customers to access the actual product pages for tickets. This can by done by adding the following PHP snippet to your theme’s functions.php file or a functionality plugin.

<?php
/*
 * Description: Prevent hijacking WooCommerce product pages for tickets.
 *
 * Usage: Add the snippet to your functions.php file or with a plugin like Code Snippets.
 *        Make sure to NOT have duplicate opening <?php tags.
 *
 * Plugins required: Event Tickets, Event Tickets Plus
 */
add_action( 'init', function() {
	if ( ! class_exists( 'Tribe__Tickets_Plus__Commerce__WooCommerce__Main' ) ) {
		return;
	}

	$woo_tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_instance();
	remove_filter( 'post_type_link', [ $woo_tickets, 'hijack_ticket_link' ], 10, 4  );
} );

Next, you’ll probably still want to link to the relevant product pages from within the single event page. To do that, create a custom template in [your-theme]/tribe/tickets/v2/tickets.php. Here is a basic example of how you could display ticket/product details in the template:

<ul>
	<?php
	foreach ( $tickets as $ticket ) {
		$product = new WC_Product( $ticket->ID );
		$price = $product->get_price_html();
		$link = '<a href="' . $product->get_permalink() . '">Buy Now!</a>';
		echo "<li>$ticket->name $price $link</li>";
	}
	?>
</ul>

With that done, customers can now proceed to the product page to make their ticket purchases, helping you to leverage other add-ons or implement special customizations.

Taking it further

The astute reader may realize that we now have a template that lists all tickets for an event and links directly to the actual product page – and wonder why we can’t provide those same links directly from a different view, such as list view (thus further reducing the number of steps the visitor has to follow).

In fact, this is relatively easy and, as a further customization, a custom template can be created to add our custom ticket links in the calendar list view. To do this, copy event-tickets/src/views/v2/list/event/cost.php to [your-theme]/tribe/tickets/v2/list/event/cost.php. Replace the contents of this file with the following code in addition to your custom code to display links to product(s). (You can use the snippet above to display the products.)

<?php
$this->template( 'v2/tickets', [
	'tickets' => Tribe__Tickets__Tickets::get_all_event_tickets( get_the_ID() )
] );

//Your custom code to display links to product(s) goes here

Wrapping up

Please do remember that this is only a rough guide and the idea is to give you a starting point. If you need to do something slightly different or build something more advanced then we’ll need to leave it to you to work out the details!