LLMS_Order::get_revenue( string $type = 'net' )

Gets the total revenue of an order


Parameters Parameters

$type

(string) (Optional) Revenue type [grosse|net]. Default is 'net'.

Default value: 'net'


Top ↑

Return Return

(float)


Top ↑

Source Source

File: includes/models/model.llms.order.php

	public function get_revenue( $type = 'net' ) {

		if ( $this->is_legacy() ) {

			$amount = $this->get( 'total' );

		} else {

			$amount = $this->get_transaction_total( 'amount' );

			if ( 'net' === $type ) {

				$refunds = $this->get_transaction_total( 'refund_amount' );

				$amount = $amount - $refunds;

			}
		}

		return apply_filters( 'llms_order_get_revenue', $amount, $type, $this );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.1.3 Handle legacy orders.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.