ModelDiscounts module
Discount
A model in the Discounts module, with 17 members for templates, 13 API properties and 24 members for admin templates.
Templates view
Properties 16
Take no arguments.
-
#
getId() -
?int -
#
getName() -
?string -
#
getPosition() -
?int -
#
getMaxUses() -
?int - The maximum number of times the discount can be used. The discount is considered used when a checkout is created with it. It stays used when an order is placed. Canceled orders, requested refunds, etc. do not cancel the fact of the usage.
-
#
getFrom() -
?DateTime - Start date for discount availability, not applied prior to this date. If not set, the discount is available immediately.
-
#
getTo() -
?DateTime - End date for discount availability, not applied after this date. If not set, the discount does not expire.
-
#
getRules() -
?Collection<Rule> -
#
getCodes() -
?Collection<Code> -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
Methods 1
Take arguments. The API serialises only getters that need none.
-
#
hasAnyAssociatedCodeByList(array $codes) -
bool - Checks if the discount has assigned any code of the provided list.
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.
-
#
id -
?int -
#
name -
?string -
#
position -
?int -
#
maxUses -
?int - The maximum number of times the discount can be used. The discount is considered used when a checkout is created with it. It stays used when an order is placed. Canceled orders, requested refunds, etc. do not cancel the fact of the usage.
-
#
from -
?DateTime - Start date for discount availability, not applied prior to this date. If not set, the discount is available immediately.
-
#
to -
?DateTime - End date for discount availability, not applied after this date. If not set, the discount does not expire.
-
#
rules -
?Collection<Rule> -
#
codes -
?Collection<Code>
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 23
Take no arguments.
-
#
getId() -
?int -
#
getName() -
?string -
#
getPosition() -
?int -
#
getMaxUses() -
?int - The maximum number of times the discount can be used. The discount is considered used when a checkout is created with it. It stays used when an order is placed. Canceled orders, requested refunds, etc. do not cancel the fact of the usage.
-
#
getFrom() -
?DateTime - Start date for discount availability, not applied prior to this date. If not set, the discount is available immediately.
-
#
getTo() -
?DateTime - End date for discount availability, not applied after this date. If not set, the discount does not expire.
-
#
getRules() -
?Collection<Rule> -
#
getCodes() -
?Collection<Code> -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
-
#
getCreateChildTypeLinks()Admin only -
?array -
#
getCodesCountDisplay()Admin only -
string - Returns a display codes count value, either "auto" or "code" with count value
Methods 1
Take arguments. The API serialises only getters that need none.
-
#
hasAnyAssociatedCodeByList(array $codes) -
bool - Checks if the discount has assigned any code of the provided list.
No members match the filter.