Class
Price per cycle formatting helper
public function __construct($price)Initialise price object
Parameters
| Type | Name | Description |
|---|---|---|
array | $price |
Returns self
public function cycle()Return billing cycle
Returns string
public function isFree()Is the billing cycle one time?
Returns bool
public function isOneTime()Is the billing cycle one time?
Returns bool
public function isRecurring()Is the billing cycle recurring?
Returns bool
public function setup()Return setup fees
Returns \WHMCS\View\Formatter\Price\|null
public function price()Return price
Returns \WHMCS\View\Formatter\Price
public function breakdown()Return breakdown pricing info
Returns array
public function toPrefixedString()Format price as a prefixed currency string
Returns string
public function toSuffixedString()Format price as a suffixed string
Returns string
public function toFullString()Format price as a full currency string (prefix, amount and suffix)
Returns string
public function getShortCycle()Get short two-letter version of billing cycle
Returns string
public function isYearly()Returns true if the price is a yearly price
Returns bool
public function isMonthly()Returns true if the price is a monthly price
Returns bool
public function cycleInYears()Get billing cycle in year(s)
Returns string
public function yearlyPrice(): stringGet per year price
public function cycleInMonths()Get billing cycle in month(s)
Returns string
public function monthlyPrice()Get per month price
Returns string
public function oneTimePrice()Get one time price
Returns string
public function breakdownPrice()Get best available breakdown price
Returns string
public function breakdownPriceNumeric()Get best available breakdown price as a number
Returns string
public function calculatePercentageDifference($price, $decimalPlaces = 0)Calculate percentage difference between two prices.
Will return the percentage discount from a given higher amount compared with the monthly amount from the current instantiated object.
Parameters
| Type | Name | Description |
|---|---|---|
float | $price | Higher amount to be calculated against |
int | $decimalPlaces | Number of decimals. Default 0. |
Returns float