ModelCarts module

Cart

A model in the Carts module, with 26 members for templates, 23 API properties and 26 members for admin templates.

Carts\Models\Frontend\Cart Carts\Models\Api\Cart Carts\Models\Backend\Cart Also in Carts: Item Message
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 26

Take no arguments.

# getCurrency()
Model
Gets the cart's currency, falling back to the site's default currency when the cart has none.
# getPerson()
?Person
The person to whom the current cart belongs.
# getItemTotalAsMoney()
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# getTaxTotalAsMoney()
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# getDiscountTotalAsMoney()
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTotalAsMoney()
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total - Discount Total + Tax Total. Item Total is a sum of all *available* items' Amount values.
# getCheckout()
?Checkout
Gets a checkout (if exists) associated with the current cart
# hasCheckout()
bool
Tells whether a checkout is associated with the current cart
# getRestoreUrl()
string
Gets a full url to restore a cart including a primary hostname.
# getId()
?int
# getUuid()
?string
# getAppliedDiscounts()
array
Metadata of the applied discounts.
# getDiscountCodes()
array
List of the applied discount codes.
# getTaxTotal()
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# getDiscountTotal()
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTotal()
?string
Represents the final value calculated as Item Total - Discount Total + Tax Total. Item Total is a sum of all _available_ items' Amount values.
# getLocked()
?DateTime
Last locked date for the cart.
# getAbandonedNotified()
?DateTime
The date the Abandoned event was last fired for this cart.
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getSite()
?Site
# getItems()
?Collection<Item>
# getMessages()
?Collection<Message>
# 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 23

Read-only values on the record.

# person
?Person
The person to whom the current cart belongs.
# itemTotalAsMoney
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# taxTotalAsMoney
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# discountTotalAsMoney
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# totalAsMoney
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total - Discount Total + Tax Total. Item Total is a sum of all *available* items' Amount values.
# checkout
?Checkout
Gets a checkout (if exists) associated with the current cart
# checkout
bool
Tells whether a checkout is associated with the current cart
# restoreUrl
string
Gets a full url to restore a cart including a primary hostname.
# id
?int
# uuid
?string
# appliedDiscounts
array
Metadata of the applied discounts.
# discountCodes
array
List of the applied discount codes.
# taxTotal
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# discountTotal
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# total
?string
Represents the final value calculated as Item Total - Discount Total + Tax Total. Item Total is a sum of all _available_ items' Amount values.
# locked
?DateTime
Last locked date for the cart.
# abandonedNotified
?DateTime
The date the Abandoned event was last fired for this cart.
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# site
?Site
# currency
?Currency
Gets the currency if it's set. If there is any item in the cart, the currency is set. Clearing the cart also clears its currency.
# items
?Collection<Item>
# messages
?Collection<Message>

Admin view

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

Properties 26

Take no arguments.

# getItemTotalAsMoney()
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# getTaxTotalAsMoney()
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# getDiscountTotalAsMoney()
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTotalAsMoney()
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total - Discount Total + Tax Total. Item Total is a sum of all *available* items' Amount values.
# getCheckout()
?Checkout
Gets a checkout (if exists) associated with the current cart
# hasCheckout()
bool
Tells whether a checkout is associated with the current cart
# getRestoreUrl()
string
Gets a full url to restore a cart including a primary hostname.
# getId()
?int
# getUuid()
?string
# getAppliedDiscounts()
array
Metadata of the applied discounts.
# getDiscountCodes()
array
List of the applied discount codes.
# getTaxTotal()
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# getDiscountTotal()
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTotal()
?string
Represents the final value calculated as Item Total - Discount Total + Tax Total. Item Total is a sum of all _available_ items' Amount values.
# getLocked()
?DateTime
Last locked date for the cart.
# getAbandonedNotified()
?DateTime
The date the Abandoned event was last fired for this cart.
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getPerson()
?Person
The person to whom the current cart belongs.
# getSite()
?Site
# getCurrency()
?Currency
Gets the currency if it's set. If there is any item in the cart, the currency is set. Clearing the cart also clears its currency.
# getItems()
?Collection<Item>
# getMessages()
?Collection<Message>
# 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