Tribe__Tickets_Plus__Commerce__WooCommerce__Main::include_your_tickets( WC_Order $order )
Includes the “Your Tickets” template for the checkout page.
Contents
This method initializes the Tribe__Template instance, fetches the attendees by the order ID, and then calls the appropriate template to render the Your Tickets section.
Parameters
- $order
-
(WC_Order) (Required) The WooCommerce order object.
Source
File: src/Tribe/Commerce/WooCommerce/Main.php
public function include_your_tickets( $order ): void {
// Bail if the order is not a valid WC_Order.
if ( ! $order instanceof \WC_Order ) {
return;
}
// Bail if the order ID is not valid.
$order_id = $order->get_id();
if ( empty( $order_id ) ) {
return;
}
$attendees = $this->get_attendees_by_id( $order->get_id() );
// Bail if there are no attendees.
if ( empty( $attendees ) ) {
return;
}
$template_args = [
'provider' => $this,
'provider_id' => $this->class_name,
'order' => $order,
'order_id' => $order->get_id(),
'is_tec_active' => tec_tickets_tec_events_is_active(),
'attendees' => $attendees,
];
tribe( 'tickets.editor.template' )->template( 'components/attendees-list/attendees', $template_args, true );
}
Changelog
| Version | Description |
|---|---|
| 5.8.0 | Introduced. |