ModelDiscounts module

ProductAction

Product action applies a discount to a specific product(s) in the cart.

A model in the Discounts module, with 20 members for templates, 17 API properties and 23 members for admin templates.

Discounts\Models\Frontend\ProductAction Discounts\Models\Api\ProductAction Discounts\Models\Backend\ProductAction Also in Discounts: BaseAction CartAction CartCondition Code CodeUrl CodeUrlProduct CountryCondition DateCondition Discount Log MaxUsageCondition OrderCondition PersonCondition PersonGroupCondition 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 20

Take no arguments.

# getProductIds()
array
Gets the product IDs for this action.
# 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 17

Read-only values on the record.

# productIds
array
Gets the product IDs for this action.
# 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 23

Take no arguments.

# getProductIds()
array
Gets the product IDs for this action.
# 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
# getIcon() Admin only
string
Returns the icon that represents the type
# getDefaultCurrency() Admin only
Currency
Gets the default currency for the record.
# getSupportedCurrencies() Admin only
Collection
Gets the supported currencies.