Tribe__Events__Community__Tickets__Main::add_order_item_details( int $item_id, WC_Order_Item $item, WC_Order $order )

Injects information about an order’s line item “unused” params are passed to the template


Parameters #

$item_id

(int) (Required) Item ID.

$item

(WC_Order_Item) (Required) WooCommerce Order Item object.

$order

(WC_Order) (Required) WooCommerce Order object.


Top ↑

Source #

File: src/Tribe/Main.php

	public function add_order_item_details( $unused_item_id, $item, $unused_order ) {
		// If there isn't a product ID, bail
		if ( empty( $item['product_id'] ) ) {
			return;
		}

		// If there isn't a product post for the product id, bail
		if ( ! $product = get_post( $item['product_id'] ) ) {
			return;
		}

		// If there isn't an event ID, bail
		if ( ! $event_id = get_post_meta( $product->ID, '_tribe_wooticket_for_event', true ) ) {
			return;
		}

		// If there isn't an event post for the event ID, bail
		if ( ! $event = get_post( $event_id ) ) {
			return;
		}

		$title = get_the_title( $event_id );
		include Tribe__Events__Templates::getTemplateHierarchy( 'community-tickets/modules/email-item-event-details' );
	}