Method | Description | Returns |
---|---|---|
getQuantity() | 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. | int |
getPrice() | Gets a maximum total discount price amount (the set value is included) that can be used for the discount to remain active (for the current user). | string |
getDisplayType() | Returns the nice name of a condition type | string |
getType() | Returns the type of condition | string |
getSnakeType() | Returns the type of condition in the snake case format: lowercase and connected by underline | string |
getSlugType() | Returns the type of condition in the slug format: lowercase and connected by hyphen | string |
getId() | int | |
getName() | string | |
getData() | array | |
isActive() | bool | |
getCreated() | Date the record was created. | DateTime |
getModified() | Last modification date for the record. | DateTime |
getRule() | Rule | |
isNewRecord() | Check if the record is a new record | bool |
isHierarchicalModel() | Check whether a model is a hierarchical model, i.e. can have children | bool |
isVersionedModel() | Check whether a model is versioned | bool |
Discounts\Models\Frontend\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 allow applying. Thus, the resulting total discount will be 30 + $30 + $30 + $30 = $120 with no further following applies.