Order::get_event_totals()

Get list of event totals for the order.


Return #

(array) List of event totals for the order.


Top ↑

Source #

File: src/Tribe/Payouts/Order.php

	public function get_event_totals() {
		// Get list of receivers.
		$receivers = $this->get_receivers();

		$totals = [];

		foreach ( $receivers as $receiver ) {
			$fees_per_event     = $receiver->get_fees_per_event();
			$subtotal_per_event = $receiver->get_subtotal_per_event();
			$total_per_event    = $receiver->get_total_per_event();

			foreach ( $total_per_event as $event_id => $total ) {
				$totals[ $event_id ] = [
					'fees'     => isset( $fees_per_event[ $event_id ] ) ? $fees_per_event[ $event_id ] : 0,
					'subtotal' => isset( $subtotal_per_event[ $event_id ] ) ? $subtotal_per_event[ $event_id ] : 0,
					'total'    => $total,
				];
			}
		}

		return $totals;
	}

Top ↑

Changelog #

Changelog
Version Description
4.7.1 Introduced.