ModelDiscounts module

BaseAction

Action

A model in the Discounts module, with 19 members for templates, 16 API properties and 19 members for admin templates.

Discounts\Models\Frontend\BaseAction Discounts\Models\Api\BaseAction Discounts\Models\Backend\BaseAction Also in Discounts: CartAction CartCondition Code CodeUrl CodeUrlProduct CountryCondition DateCondition Discount Log MaxUsageCondition OrderCondition PersonCondition PersonGroupCondition ProductAction ProductCategoryCondition ProductCondition Rule ShippingAction TemplateCondition
View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 19

Take no arguments.

# getDisplayType()
string
Returns the nice name of an action type
# getType()
string
Returns the type of condition
# 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
# getValue()
?string
# getModifier()
?string
# isValueModifier()
bool
Returns if the modifier set to the exact value
# isPercentModifier()
bool
Returns if the modifier set to the percent value
# isWaterfall()
bool
When true every following discount applies to the previously discounted price, when false discount is applied to the original item price
# getData()
?array
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getCurrency()
?Currency
Only applies to fixed-amount ($) actions. When set, the action is only applied when the cart currency matches. When not set, the default site currency is assumed. Percentage (%) actions always apply regardless of currency.
# getRule()
?Rule
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

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 16

Read-only values on the record.

# displayType
string
Returns the nice name of an action type
# type
string
Returns the type of condition
# 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
# value
?string
# modifier
?string
# valueModifier
bool
Returns if the modifier set to the exact value
# percentModifier
bool
Returns if the modifier set to the percent value
# waterfall
bool
When true every following discount applies to the previously discounted price, when false discount is applied to the original item price
# data
?array
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# currency
?Currency
Only applies to fixed-amount ($) actions. When set, the action is only applied when the cart currency matches. When not set, the default site currency is assumed. Percentage (%) actions always apply regardless of currency.
# rule
?Rule

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 19

Take no arguments.

# getDisplayType()
string
Returns the nice name of an action type
# getType()
string
Returns the type of condition
# 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
# getValue()
?string
# getModifier()
?string
# isValueModifier()
bool
Returns if the modifier set to the exact value
# isPercentModifier()
bool
Returns if the modifier set to the percent value
# isWaterfall()
bool
When true every following discount applies to the previously discounted price, when false discount is applied to the original item price
# getData()
?array
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getCurrency()
?Currency
Only applies to fixed-amount ($) actions. When set, the action is only applied when the cart currency matches. When not set, the default site currency is assumed. Percentage (%) actions always apply regardless of currency.
# getRule()
?Rule
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned