LLMS_Order::get_last_transaction( array|string $status = 'any', array|string $type = 'any' )

Retrieve the last (most recent) transaction processed for the order

Parameters Parameters


(array|string) (Optional) Filter by status (see transaction statuses). By default looks for any status.

Default value: 'any'


(array|string) (Optional) Filter by type [recurring|single|trial]. By default looks for any type.

Default value: 'any'

Top ↑

Return Return

(LLMS_Transaction|false) instance of the LLMS_Transaction or false if none found

Top ↑

Source Source

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

	public function get_last_transaction( $status = 'any', $type = 'any' ) {
		$txns = $this->get_transactions(
				'per_page'      => 1,
				'status'        => $status,
				'type'          => $type,
				'no_found_rows' => true,
		if ( $txns['count'] ) {
			return array_pop( $txns['transactions'] );

Top ↑

Changelog Changelog

Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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