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'
Return Return
(string)
Source Source
File: includes/models/model.llms.order.php
667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 | 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 ; } |
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |