LLMS_Order::get_coupon_amount( string $payment = 'regular' )

Get the formatted coupon amount with a currency symbol or percentage


Parameters Parameters

$payment

(string) (Optional) Coupon discount type, either 'regular' or 'trial'.

Default value: 'regular'


Top ↑

Return Return

(string)


Top ↑

Source Source

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

	public function get_coupon_amount( $payment = 'regular' ) {

		if ( 'regular' === $payment ) {
			$amount = $this->get( 'coupon_amount' );
		} elseif ( 'trial' === $payment ) {
			$amount = $this->get( 'coupon_amount_trial' );
		}

		$type = $this->get( 'coupon_type' );
		if ( 'percent' === $type ) {
			$amount = $amount . '%';
		} elseif ( 'dollar' === $type ) {
			$amount = llms_price( $amount );
		}
		return $amount;

	}


Top ↑

Changelog 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.