ModelCarts module
Item
Item that appears in the Cart for the first time and then can go to the Order
A model in the Carts module, with 31 members for templates, 27 API properties and 32 members for admin templates.
Templates view
Properties 30
Take no arguments.
-
#
getUnitAmountAsMoney() -
Money - Gets the amount for a single unit (quantity = 1) as a Money object. Represents the value per unit before tax and discount are applied.
-
#
getUnitDiscountAsMoney() -
Money - Gets the discount for a single unit (quantity = 1) as a Money object. Represents the discount value per unit.
-
#
getUnitTaxAsMoney() -
Money - Gets the tax for a single unit (quantity = 1) as a Money object. Represents the tax value per unit.
-
#
getUnitTotalAsMoney() -
Money - Gets the total for a single unit (quantity = 1) as a Money object. Represents the final value per unit calculated as
Unit Amount - Unit Discount + Unit Tax. -
#
getAmountAsMoney() -
Money - Gets the amount for the entire quantity as a Money object. Represents the value before applying tax and discount (
Unit Amount × Quantity). -
#
getDiscountAsMoney() -
Money - Gets the discount for the entire quantity as a Money object. Represents the total discount applied (
Unit Discount × Quantity). -
#
getTaxAsMoney() -
Money - Gets the tax for the entire quantity as a Money object. Represents the total tax calculated (
Unit Tax × Quantity). -
#
getTotalAsMoney() -
Money - Gets the total for the entire quantity as a Money object. Represents the final value calculated as
Amount - Discount + Tax. -
#
getUnitPriceAsMoney() -
Money - It's an alias and deprecated! Directly use
getUnitAmountAsMoney()instead. -
#
getItemPrice() -
string - It's deprecated! Directly use
getUnitAmountAsMoney()(convert to string at first) instead. -
#
getId() -
?int -
#
getProductCode() -
?string -
#
getName() -
?string -
#
getQuantity() -
?int - The number of units purchased. Quantity of the item. Integer positive (not 0) number.
-
#
getAmount() -
?string - Represents the value before applying tax and discount (
Unit Amount × Quantity). -
#
getAttributes() -
array -
#
isAvailable() -
bool - If an item is available, i.e., its product still available, or the item is not expired.
-
#
getOrder() -
?BaseOrder -
#
getProduct() -
?BaseProduct -
#
getMessages() -
?Collection<Message> -
#
getDiscountLogs() -
?Collection<Log> - Gets discount logs associated with an item. Logs are changing only on the checkout operations, not inside the cart.
-
#
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.
-
#
getAttribute(string $name, ?string $default) -
?string - Gets an item attribute by its name. If not specified, returns a default value. Name is case-sensitive, e.g., "color" and "Color" are two different attributes.
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 27
Read-only values on the record.
-
#
unitAmountAsMoney -
Money - Gets the amount for a single unit (quantity = 1) as a Money object. Represents the value per unit before tax and discount are applied.
-
#
unitDiscountAsMoney -
Money - Gets the discount for a single unit (quantity = 1) as a Money object. Represents the discount value per unit.
-
#
unitTaxAsMoney -
Money - Gets the tax for a single unit (quantity = 1) as a Money object. Represents the tax value per unit.
-
#
unitTotalAsMoney -
Money - Gets the total for a single unit (quantity = 1) as a Money object. Represents the final value per unit calculated as
Unit Amount - Unit Discount + Unit Tax. -
#
amountAsMoney -
Money - Gets the amount for the entire quantity as a Money object. Represents the value before applying tax and discount (
Unit Amount × Quantity). -
#
discountAsMoney -
Money - Gets the discount for the entire quantity as a Money object. Represents the total discount applied (
Unit Discount × Quantity). -
#
taxAsMoney -
Money - Gets the tax for the entire quantity as a Money object. Represents the total tax calculated (
Unit Tax × Quantity). -
#
totalAsMoney -
Money - Gets the total for the entire quantity as a Money object. Represents the final value calculated as
Amount - Discount + Tax. -
#
itemPrice -
string - It's deprecated! Directly use
getUnitAmountAsMoney()(convert to string at first) instead. -
#
id -
?int -
#
productCode -
?string -
#
name -
?string -
#
quantity -
?int - The number of units purchased. Quantity of the item. Integer positive (not 0) number.
-
#
attributes -
array -
#
available -
bool - If an item is available, i.e., its product still available, or the item is not expired.
-
#
order -
?BaseOrder -
#
product -
?BaseProduct -
#
messages -
?Collection<Message> -
#
discountLogs -
?Collection<Log> - Gets discount logs associated with an item. Logs are changing only on the checkout operations, not inside the cart.
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 30
Take no arguments.
-
#
getUnitAmountAsMoney() -
Money - Gets the amount for a single unit (quantity = 1) as a Money object. Represents the value per unit before tax and discount are applied.
-
#
getUnitDiscountAsMoney() -
Money - Gets the discount for a single unit (quantity = 1) as a Money object. Represents the discount value per unit.
-
#
getUnitTaxAsMoney() -
Money - Gets the tax for a single unit (quantity = 1) as a Money object. Represents the tax value per unit.
-
#
getUnitTotalAsMoney() -
Money - Gets the total for a single unit (quantity = 1) as a Money object. Represents the final value per unit calculated as
Unit Amount - Unit Discount + Unit Tax. -
#
getAmountAsMoney() -
Money - Gets the amount for the entire quantity as a Money object. Represents the value before applying tax and discount (
Unit Amount × Quantity). -
#
getDiscountAsMoney() -
Money - Gets the discount for the entire quantity as a Money object. Represents the total discount applied (
Unit Discount × Quantity). -
#
getTaxAsMoney() -
Money - Gets the tax for the entire quantity as a Money object. Represents the total tax calculated (
Unit Tax × Quantity). -
#
getTotalAsMoney() -
Money - Gets the total for the entire quantity as a Money object. Represents the final value calculated as
Amount - Discount + Tax. -
#
getUnitPriceAsMoney() -
Money - It's an alias and deprecated! Directly use
getUnitAmountAsMoney()instead. -
#
getItemPrice() -
string - It's deprecated! Directly use
getUnitAmountAsMoney()(convert to string at first) instead. -
#
getId() -
?int -
#
getProductCode() -
?string -
#
getName() -
?string -
#
getQuantity() -
?int - The number of units purchased. Quantity of the item. Integer positive (not 0) number.
-
#
getAmount() -
?string - Represents the value before applying tax and discount (
Unit Amount × Quantity). -
#
getAttributes() -
array -
#
isAvailable() -
bool - If an item is available, i.e., its product still available, or the item is not expired.
-
#
getOrder() -
?BaseOrder -
#
getProduct() -
?BaseProduct -
#
getMessages() -
?Collection<Message> -
#
getDiscountLogs() -
?Collection<Log> - Gets discount logs associated with an item. Logs are changing only on the checkout operations, not inside the cart.
-
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
Methods 2
Take arguments. The API serialises only getters that need none.
-
#
getAttribute(string $name, ?string $default) -
?string - Gets an item attribute by its name. If not specified, returns a default value. Name is case-sensitive, e.g., "color" and "Color" are two different attributes.
No members match the filter.