WordPress at Your Fingertips
function is not described

WC_Abstract_Order::get_line_total() public WC 1.0

Calculate line total - useful for gateways.

{} It's a method of the class: WC_Abstract_Order{}

Hooks from the method

Return

float.

Usage

$WC_Abstract_Order = new WC_Abstract_Order();
$WC_Abstract_Order->get_line_total( $item, $inc_tax, $round );
$item(object) (required)
Item to get total from.
$inc_tax(true|false)
(default: false).
Default: false
$round(true|false)
(default: true).
Default: true

Code of WC_Abstract_Order::get_line_total() WC 5.8.0

public function get_line_total( $item, $inc_tax = false, $round = true ) {
	$total = 0;

	if ( is_callable( array( $item, 'get_total' ) ) ) {
		// Check if we need to add line tax to the line total.
		$total = $inc_tax ? $item->get_total() + $item->get_total_tax() : $item->get_total();

		// Check if we need to round.
		$total = $round ? NumberUtil::round( $total, wc_get_price_decimals() ) : $total;
	}

	return apply_filters( 'woocommerce_order_amount_line_total', $total, $this, $item, $inc_tax, $round );
}