LLMS_Access_Plan::requires_payment( int $coupon_id = null )

Determine if the access plan requires payment.


Description Description

Automatically accounts for coupons, sales, trials, and whether the plan is marked as free.


Top ↑

Parameters Parameters

$coupon_id

(int) (Optional) LLMS_Coupon ID.

Default value: null


Top ↑

Return Return

(bool) true if payment required, false otherwise


Top ↑

Source Source

File: includes/models/model.llms.access.plan.php

		$ret = false;

		if ( ! $this->is_free() ) {

			$ret = ( $this->get_initial_price( array(), $coupon_id, 'float' ) > 0 );

			// Ensure that we still collect payment details if a free trial is used.
			if ( false === $ret ) {
				$price_key = $this->is_on_sale() ? 'sale_price' : 'price';
				$ret       = ( $this->get_price( $price_key, array(), 'float', $coupon_id ) > 0 );
			}
		}

		return apply_filters( 'llms_plan_requires_payment', $ret, $coupon_id, $this );

	}



Top ↑

Changelog Changelog

Changelog
Version Description
3.30.1 Uses self::get_initial_price().
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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