LLMS_Admin_Tool_Limited_Billing_Order_Locator::get_order_csv( LLMS_Order $order )

Retrieves an array representing a line in generated CSV for the given order.


Description Description

An order is considered to be affected by the change if either of the following conditions are true:

  • Any number of refunds exist for the order. Since we are now counting refunds towards the billing limit an active order with any number of refunds should be reviewed by the admin.

  • The plan is marked as "ended" and the total number of successful payments is not equal to the billing length. In this scenario admins will likely want to add additional payments and start the order again.


Top ↑

Parameters Parameters

$order

(LLMS_Order) (Required) The order object.


Top ↑

Return Return

(array) Array of information on the order to be stored in the generated CSV or an empty array of the order was not affected by the change.


Top ↑

Source Source

File: includes/admin/tools/class-llms-admin-tool-limited-billing-order-locator.php

	protected function get_order_csv( $order ) {

		$refunds   = $this->get_txn_count_by_status( $order, 'llms-txn-refunded' );
		$successes = $this->get_txn_count_by_status( $order, 'llms-txn-succeeded' );
		$total     = $refunds + $successes;

		$ended    = llms_parse_bool( $order->get( 'plan_ended' ) );
		$expected = $order->get( 'billing_length' );

		if ( $refunds >= 1 || ( $ended && $total !== $expected ) ) {

			$id   = $order->get( 'id' );
			$link = get_edit_post_link( $id, 'raw' );
			return array( $id, $expected, $total, $successes, $refunds, $link );

		}

		return array();

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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