Value::get_shortcode_price_html()

Get formatted html block with formatted currency and symbol.

Contents


Return

(string)


Top ↑

Source

File: src/Tickets/Commerce/Utils/Value.php

	public function get_shortcode_price_html() {

		$position = 'prefix' === $this->get_currency_symbol_position() ? 'prefix' : 'postfix';

		$html[] = "<span class'tribe-formatted-currency-wrap tribe-currency-{$position}'>";
		$html[] = '<span class="tribe-currency-symbol">%1$s</span>';
		$html[] = '<span class="tribe-amount">%2$s</span>';
		$html[] = '</span>';

		if ( $position !== 'prefix' ) {
			// If position is not prefix, swap the symbol and amount span tags.
			$hold    = $html[1];
			$html[1] = $html[2];
			$html[2] = $hold;
		}

		return sprintf( implode( '', $html ),
			esc_html( $this->get_currency_symbol() ),
			esc_html( $this->get_string() )
		);

	}