Automattic\WooCommerce\Internal\Email

OrderPriceFormatter::format_price │ private static │ WC 1.0

Helper method to format price with or without tax.

Метод класса: OrderPriceFormatter{}

Хуков нет.

Возвращает

string. Formatted price string.

Использование

$result = OrderPriceFormatter::format_price( $order, $amount, $includes_tax ): string;
$order(WC_Abstract_Order) (обязательный)
Order instance.
$amount(float) (обязательный)
The amount to format.
$includes_tax(true|false) (обязательный)
Whether to include tax in the formatted price.

Код OrderPriceFormatter::format_price() WC 11.2.2

private static function format_price( WC_Abstract_Order $order, float $amount, bool $includes_tax ): string {
	return wc_price(
		$amount,
		array(
			'ex_tax_label' => ( ! $includes_tax && $order->get_prices_include_tax() ) ? 1 : 0,
			'currency'     => $order->get_currency(),
		)
	);
}