WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Order::get_formatted_order_total() WC 1.0

Gets order total - formatted for display.

Это метод класса: WC_Order

Хуки из метода
Возвращает

Строку.

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

$WC_Order = new WC_Order();
$var = $WC_Order->get_formatted_order_total( $tax_display, $display_refunded );
$tax_display(строка)
Type of tax display.
По умолчанию: ''
$display_refunded(true/false)
If should include refunded value.
По умолчанию: true

Код WC Order::get formatted order total: woocommerce/includes/class-wc-order.php WC 3.6.3

<?php
public function get_formatted_order_total( $tax_display = '', $display_refunded = true ) {
	$formatted_total = wc_price( $this->get_total(), array( 'currency' => $this->get_currency() ) );
	$order_total     = $this->get_total();
	$total_refunded  = $this->get_total_refunded();
	$tax_string      = '';

	// Tax for inclusive prices.
	if ( wc_tax_enabled() && 'incl' === $tax_display ) {
		$tax_string_array = array();
		$tax_totals       = $this->get_tax_totals();

		if ( 'itemized' === get_option( 'woocommerce_tax_total_display' ) ) {
			foreach ( $tax_totals as $code => $tax ) {
				$tax_amount         = ( $total_refunded && $display_refunded ) ? wc_price( WC_Tax::round( $tax->amount - $this->get_total_tax_refunded_by_rate_id( $tax->rate_id ) ), array( 'currency' => $this->get_currency() ) ) : $tax->formatted_amount;
				$tax_string_array[] = sprintf( '%s %s', $tax_amount, $tax->label );
			}
		} elseif ( ! empty( $tax_totals ) ) {
			$tax_amount         = ( $total_refunded && $display_refunded ) ? $this->get_total_tax() - $this->get_total_tax_refunded() : $this->get_total_tax();
			$tax_string_array[] = sprintf( '%s %s', wc_price( $tax_amount, array( 'currency' => $this->get_currency() ) ), WC()->countries->tax_or_vat() );
		}

		if ( ! empty( $tax_string_array ) ) {
			/* translators: %s: taxes */
			$tax_string = ' <small class="includes_tax">' . sprintf( __( '(includes %s)', 'woocommerce' ), implode( ', ', $tax_string_array ) ) . '</small>';
		}
	}

	if ( $total_refunded && $display_refunded ) {
		$formatted_total = '<del>' . strip_tags( $formatted_total ) . '</del> <ins>' . wc_price( $order_total - $total_refunded, array( 'currency' => $this->get_currency() ) ) . $tax_string . '</ins>';
	} else {
		$formatted_total .= $tax_string;
	}

	/**
	 * Filter WooCommerce formatted order total.
	 *
	 * @param string   $formatted_total  Total to display.
	 * @param WC_Order $order            Order data.
	 * @param string   $tax_display      Type of tax display.
	 * @param bool     $display_refunded If should include refunded value.
	 */
	return apply_filters( 'woocommerce_get_formatted_order_total', $formatted_total, $this, $tax_display, $display_refunded );
}