Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Order::calculate_billing_end_date()

Calculate the date when billing should applicable to orders created from plans with a set # of billing intervals


Return Return

(int)


Top ↑

Source Source

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

		$this->set( 'order_key', $this->generate_order_key() );
	}

	/**
	 * Calculate the next payment due date
	 *
	 * @since 3.10.0
	 * @since 3.12.0 Unknown.
	 * @since 3.37.6 Now uses the last successful transaction time to calculate from when the previously
	 *               stored next payment date is in the future.
	 * @since 4.9.0 Fix comparison for PHP8 compat.
	 * @since 5.3.0 Determine if a limited order has ended based on number of remaining payments in favor of current date/time.
	 *
	 * @param string $format PHP date format used to format the returned date string.
	 * @return string The formatted next payment due date or an empty string when there is no next payment.
	 */
	private function calculate_next_payment_date( $format = 'Y-m-d H:i:s' ) {

		// If the limited plan has already ended return early.
		$remaining = $this->get_remaining_payments();
		if ( 0 === $remaining ) {
			// This filter is documented below.
			return apply_filters( 'llms_order_calculate_next_payment_date', '', $format, $this );
		}

Top ↑

Changelog Changelog

Changelog
Version Description
3.10.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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