Returns all available types a commission can have.
(array) An associative array containing the slugs, as keys, and data arrays, as values, of the type that a commission can have.
$commission_types = slicewp_get_commission_types();
// Returned value. Array ( [sale] => Array ( [label] => Sale [rate_types] => Array (  => percentage  => fixed_amount ) ) [subscription] => Array ( [label] => Subscription [rate_types] => Array (  => percentage  => fixed_amount ) ) [recurring] => Array ( [label] => Recurring [rate_types] => Array (  => percentage  => fixed_amount ) ) )
The returned array can be filtered by applying a callback to the slicewp_register_commission_types filter.
Each commission type has at least the
label is a string representing the name of the commission’s type and it’s used for output purposes.
rate_types is an array representing the type of rates a commission’s amount can be calculated by. The rate types can be either
For example, a commission of type
sale will most probably be tied to an order from your eCommerce integration (let’s say WooCommerce). Because the amount of the commission can have both a fixed amount, not correlated with the order’s value, and also a percentage based amount, calculated from the order’s value, the
sale commission type has both the
fixed_amount rate types.
On the other hand, a commission of type
user_signup is not tied to an order, which has a value, but rather to an action, in this case a user signing up for a service. Because of this, the rate type can only be