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

WC_Abstract_Order::get_subtotal_to_display() WC 1.0

Gets subtotal - subtotal is shown before discounts, but with localised taxes.

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

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

Строку.

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

$WC_Abstract_Order = new WC_Abstract_Order();
$var = $WC_Abstract_Order->get_subtotal_to_display( $compound, $tax_display );
$compound(true/false)
(default: false).
По умолчанию: false
$tax_display(строка)
(default: the tax_display_cart value).
По умолчанию: ''

Код WC Abstract Order::get subtotal to display: woocommerce/includes/abstracts/abstract-wc-order.php WC 3.6.5

<?php
public function get_subtotal_to_display( $compound = false, $tax_display = '' ) {
	$tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' );
	$subtotal    = 0;

	if ( ! $compound ) {
		foreach ( $this->get_items() as $item ) {
			$subtotal += $item->get_subtotal();

			if ( 'incl' === $tax_display ) {
				$subtotal += $item->get_subtotal_tax();
			}
		}

		$subtotal = wc_price( $subtotal, array( 'currency' => $this->get_currency() ) );

		if ( 'excl' === $tax_display && $this->get_prices_include_tax() && wc_tax_enabled() ) {
			$subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
		}
	} else {
		if ( 'incl' === $tax_display ) {
			return '';
		}

		foreach ( $this->get_items() as $item ) {
			$subtotal += $item->get_subtotal();
		}

		// Add Shipping Costs.
		$subtotal += $this->get_shipping_total();

		// Remove non-compound taxes.
		foreach ( $this->get_taxes() as $tax ) {
			if ( $tax->is_compound() ) {
				continue;
			}
			$subtotal = $subtotal + $tax->get_tax_total() + $tax->get_shipping_tax_total();
		}

		// Remove discounts.
		$subtotal = $subtotal - $this->get_total_discount();
		$subtotal = wc_price( $subtotal, array( 'currency' => $this->get_currency() ) );
	}

	return apply_filters( 'woocommerce_order_subtotal_to_display', $subtotal, $compound, $this );
}