ModelDiscounts module
MaxUsageCondition
Max usage condition describes the conditions that need to be met for the discount to be applied; based on usage quantity (for the current discount) or total discount price (in discount logs).
Applies to the current user. There are no "from/to" fields as they don't make sense.
The amount value is the discounted price amount.
If a discount gives $30 off, and the amount in this condition is set to $100, a user could use $30 + $30 + $30 = $90 (which is clear). However, then there is no restriction for the discounted price (because the action is responsible for that, not a condition),
and the condition for the 4th time is $90 < $100 => allow applying. Thus, the resulting total discount will be 30 + $30 + $30 + $30 = $120 with no further following applies.
A model in the Discounts module, with 16 members for templates, 13 API properties and 17 members for admin templates.
Templates view
Properties 16
Take no arguments.
-
#
getQuantity() -
?int - Gets a maximum number of usages (the set value is included) that can be applied for the discount to remain active. Checks for the current user.
-
#
getAmount() -
?string - Gets a maximum total discounted price provided (the set value is included) that can be used for the discount to remain active (for the current user).
-
#
getSnakeType() -
string - Returns the type of condition in the snake case format: lowercase and connected by underline
-
#
getSlugType() -
string - Returns the type of condition in the slug format: lowercase and connected by hyphen
-
#
getId() -
?int -
#
getName() -
?string -
#
getData() -
?array -
#
isActive() -
bool -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
No members match the filter.
API & Jobs view
API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.
Properties 13
Read-only values on the record.
-
#
quantity -
?int - Gets a maximum number of usages (the set value is included) that can be applied for the discount to remain active. Checks for the current user.
-
#
amount -
?string - Gets a maximum total discounted price provided (the set value is included) that can be used for the discount to remain active (for the current user).
-
#
snakeType -
string - Returns the type of condition in the snake case format: lowercase and connected by underline
-
#
slugType -
string - Returns the type of condition in the slug format: lowercase and connected by hyphen
-
#
id -
?int -
#
name -
?string -
#
data -
?array -
#
active -
bool
No members match the filter.
Admin view
AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.
Properties 17
Take no arguments.
-
#
getQuantity() -
?int - Gets a maximum number of usages (the set value is included) that can be applied for the discount to remain active. Checks for the current user.
-
#
getAmount() -
?string - Gets a maximum total discounted price provided (the set value is included) that can be used for the discount to remain active (for the current user).
-
#
getSnakeType() -
string - Returns the type of condition in the snake case format: lowercase and connected by underline
-
#
getSlugType() -
string - Returns the type of condition in the slug format: lowercase and connected by hyphen
-
#
getId() -
?int -
#
getName() -
?string -
#
getData() -
?array -
#
isActive() -
bool -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
No members match the filter.