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

WC_Cart::get_product_subtotal() public WC 1.0

Get the product row subtotal.

Gets the tax etc to avoid rounding issues.

When on the checkout (review order), this will get the subtotal based on the customer's tax rate rather than the base rate.

Это метод класса: WC_Cart{}

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

Строку. formatted price

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

$WC_Cart = new WC_Cart();
$WC_Cart->get_product_subtotal( $product, $quantity );
$product(WC_Product) (обязательный)
Product object.
$quantity(число) (обязательный)
Quantity being purchased.

Код WC_Cart::get_product_subtotal() WC 4.5.2

woocommerce/includes/class-wc-cart.php
<?php
public function get_product_subtotal( $product, $quantity ) {
	$price = $product->get_price();

	if ( $product->is_taxable() ) {

		if ( $this->display_prices_including_tax() ) {
			$row_price        = wc_get_price_including_tax( $product, array( 'qty' => $quantity ) );
			$product_subtotal = wc_price( $row_price );

			if ( ! wc_prices_include_tax() && $this->get_subtotal_tax() > 0 ) {
				$product_subtotal .= ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>';
			}
		} else {
			$row_price        = wc_get_price_excluding_tax( $product, array( 'qty' => $quantity ) );
			$product_subtotal = wc_price( $row_price );

			if ( wc_prices_include_tax() && $this->get_subtotal_tax() > 0 ) {
				$product_subtotal .= ' <small class="tax_label">' . WC()->countries->ex_tax_or_vat() . '</small>';
			}
		}
	} else {
		$row_price        = $price * $quantity;
		$product_subtotal = wc_price( $row_price );
	}

	return apply_filters( 'woocommerce_cart_product_subtotal', $product_subtotal, $product, $quantity, $this );
}