WC_Abstract_Order::get_formatted_line_subtotal( object $item, string $tax_display = '' )
Gets line subtotal – formatted for display.
Description Description
Parameters Parameters
- $item
-
(Required) Item to get total from.
- $tax_display
-
(Optional) Incl or excl tax display mode.
Default value: ''
Return Return
(string)
Source Source
File: includes/abstracts/abstract-wc-order.php
public function get_formatted_line_subtotal( $item, $tax_display = '' ) {
$tax_display = $tax_display ? $tax_display : get_option( 'woocommerce_tax_display_cart' );
if ( 'excl' === $tax_display ) {
$ex_tax_label = $this->get_prices_include_tax() ? 1 : 0;
$subtotal = wc_price(
$this->get_line_subtotal( $item ),
array(
'ex_tax_label' => $ex_tax_label,
'currency' => $this->get_currency(),
)
);
} else {
$subtotal = wc_price( $this->get_line_subtotal( $item, true ), array( 'currency' => $this->get_currency() ) );
}
return apply_filters( 'woocommerce_order_formatted_line_subtotal', $subtotal, $item, $this );
}