Tribe__Tickets_Plus__Commerce__WooCommerce__Main::do_metabox_sku_options( $post_id, int $ticket_id = null )

Add the sku field in the admin’s new/edit ticket metabox


Parameters

$post_id

(Required) int id of the event post

$ticket_id

(int) (Optional) (null) id of the ticket

Default value: null


Top ↑

Return

(void)


Top ↑

Source

File: src/Tribe/Commerce/WooCommerce/Main.php

	public function do_metabox_sku_options( $post_id, $ticket_id = null ) {
		$sku                 = '';
		$is_correct_provider = tribe( 'tickets.handler' )->is_correct_provider( $post_id, $this );

		if ( ! empty( $ticket_id ) ) {
			$ticket              = $this->get_ticket( $post_id, $ticket_id );
			$is_correct_provider = tribe( 'tickets.handler' )->is_correct_provider( $ticket_id, $this );

			if ( ! empty( $ticket ) ) {
				$sku = get_post_meta( $ticket_id, '_sku', true );
			}
		}

		// Bail when we are not dealing with this provider
		if ( ! $is_correct_provider ) {
			return;
		}

		include $this->plugin_path . 'src/admin-views/woocommerce-metabox-sku.php';
	}

Top ↑

Changelog

Changelog
Version Description
4.6 Introduced.