Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_formatted_price( string $price )

Maybe format price display for ticket edit form.


Parameters

$price

(string) (Required) Price.


Top ↑

Return

(string) Formatted price.


Top ↑

Source

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

	public function get_formatted_price( $price ) {

		if ( ! $this->should_show_regular_price() ) {
			return $price;
		}

		$args = [
			'decimal_separator'  => wc_get_price_decimal_separator(),
			'thousand_separator' => wc_get_price_thousand_separator(),
			'decimals'           => wc_get_price_decimals(),
		];

		$formatted_price = number_format( $price, $args['decimals'], $args['decimal_separator'], $args['thousand_separator'] );

		/**
		 * Filter the formatted price for ticket edit form.
		 *
		 * @since 5.2.7
		 *
		 * @param string $formatted_price Formatted price.
		 * @param string $price Original price data.
		 * @param array $args Arguments containing the formatting options for numbers of decimals, decimals and thousands separators.
		 */
		return apply_filters( 'tribe_tickets_plus_ticket_edit_form_formatted_price', $formatted_price, $price, $args );
	}

Top ↑

Changelog

Changelog
Version Description
5.2.7 Introduced.