Tribe__Tickets__Commerce__PayPal__Main::get_price_html( int|object $product, array|boolean $attendee = false )

Get’s the product price html


Parameters

$product

(int|object) (Required)

$attendee

(array|boolean) (Optional)

Default value: false


Top ↑

Return

(string)


Top ↑

Source

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

	public function get_price_html( $product, $attendee = false ) {
		$product_id = $product;

		if ( $product instanceof WP_Post ) {
			$product_id = $product->ID;
		} elseif ( is_numeric( $product_id ) ) {
			$product = get_post( $product_id );
		} else {
			return '';
		}

		$price = get_post_meta( $product_id, '_price', true );
		$price = tribe( 'tickets.commerce.paypal.currency' )->format_currency( $price, $product_id );

		$price_html = '<span class="tribe-tickets-price-amount amount">' . esc_html( $price ) . '</span>';

		/**
		 * Allow filtering of the Price HTML
		 *
		 * @since 4.7
		 *
		 * @param string $price_html
		 * @param mixed  $product
		 * @param mixed  $attendee
		 *
		 */
		return apply_filters( 'tribe_tickets_tpp_ticket_price_html', $price_html, $product, $attendee );
	}

Top ↑

Changelog

Changelog
Version Description
4.7 Introduced.