ModelOrders module

Order

A model in the Orders module, with 53 members for templates, 55 API properties and 60 members for admin templates.

Orders\Models\Frontend\Order Orders\Models\Api\Order Orders\Models\Backend\Order Also in Orders: MetadataField MetadataFieldValue Refund RefundItem
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 53

Take no arguments.

# getFulfillmentStatusLabels()
array
Gets all available fulfillment statuses with their labels
# getFulfillmentStatusDisplay()
string
Gets fulfillment status display label
# getFinancialStatusLabels()
array
Gets all available financial statuses with their labels
# getFulfillmentStatusSummary()
string
The fulfillment status as the orders list shows it: its label, followed by "Backorder" while a fulfillment of the order waits for stock - "Pending · Backorder" Read from the order's own columns, so the list does not load the fulfillments of each row. On the shared model because the admin's list loads its rows through the API.
# getFinancialStatusDisplay()
string
Gets financial status display label
# getRefundedTotalAsMoney()
Money
Get the amount refunded
# getPendingRefundTotalAsMoney()
Money
Get the amount of refunds the payment service has not yet completed or failed
# getRefundableTotalAsMoney()
Money
Get the amount still available to refund. Pending refunds are held back as well as completed ones, so a second refund cannot claim money that is already being returned.
# isRefundable()
bool
Is the order refundable?
# getNumber()
?string
# getOrdered()
?DateTime
The time which order was placed
# getFinancialStatus()
?string
Set the financial status of the order. Values include: unpaid, authorized, partially_paid, paid, partially_refunded, refunded, voided.
# getFulfillmentStatus()
?string
Set the fulfillment status of the order. Values include: none, pending, partial, fulfilled, completed.
# getHasBackorder()
?bool
Whether a fulfillment of the order waits for stock
# getRefunds()
?Collection<Refund>
# getItemTotalAsMoney()
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# getShippingTotalAsMoney()
Money
Gets the shipping total as a Money object. Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotalAsMoney()
Money
Gets the handling total as a Money object. Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotalAsMoney()
Money
Gets the insurance total as a Money object. Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotalAsMoney()
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotalAsMoney()
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotalAsMoney()
Money
Gets the surcharge total as a Money object. Represents the surcharge total.
# getTotalAsMoney()
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getInvoices()
Collection
Get all invoices linked to this order (Order, Checkout)
# getCurrencyCode()
string
Get currency code
# getId()
?int
# getUuid()
?string
# getComments()
?string
# getData()
?array
# getAppliedDiscounts()
array
Metadata of the applied discounts.
# getDiscountCodes()
array
List of the applied discount codes.
# getShippingTotal()
?string
Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotal()
?string
Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotal()
?string
Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotal()
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotal()
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotal()
?string
Represents the surcharge total.
# getTotal()
?string
Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getBillingAddress()
?Address
# getDeliveryAddress()
?Address
# getCurrency()
?Currency
# getPerson()
?Person
# getSite()
?Site
# getItems()
?Collection<Item>
# getMessages()
?Collection<Message>
# getFulfillments()
?Collection<Fulfillment>
# getMetadataFieldValues()
?Collection<MetadataFieldValue>
# getSourceEntity()
?string
Get the source record entity
# getSourceUuid()
?string
Get the source record uuid
# getDiscountLogs()
?Collection<Log>
# getExternalId()
?string

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 55

Read-only values on the record.

# fulfillmentStatusLabels
array
Gets all available fulfillment statuses with their labels
# fulfillmentStatusDisplay
string
Gets fulfillment status display label
# financialStatusLabels
array
Gets all available financial statuses with their labels
# fulfillmentStatusSummary
string
The fulfillment status as the orders list shows it: its label, followed by "Backorder" while a fulfillment of the order waits for stock - "Pending · Backorder" Read from the order's own columns, so the list does not load the fulfillments of each row. On the shared model because the admin's list loads its rows through the API.
# financialStatusDisplay
string
Gets financial status display label
# refundedTotalAsMoney
Money
Get the amount refunded
# pendingRefundTotalAsMoney
Money
Get the amount of refunds the payment service has not yet completed or failed
# refundableTotalAsMoney
Money
Get the amount still available to refund. Pending refunds are held back as well as completed ones, so a second refund cannot claim money that is already being returned.
# refundable
bool
Is the order refundable?
# editUrl Not in Templates
?string
Get the url for editing the record.
# number
?string
# ordered
?DateTime
The time which order was placed
# financialStatus
?string
Set the financial status of the order. Values include: unpaid, authorized, partially_paid, paid, partially_refunded, refunded, voided.
# fulfillmentStatus
?string
Set the fulfillment status of the order. Values include: none, pending, partial, fulfilled, completed.
# hasBackorder
?bool
Whether a fulfillment of the order waits for stock
# refunds
?Collection<Refund>
# itemTotalAsMoney
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# shippingTotalAsMoney
Money
Gets the shipping total as a Money object. Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# handlingTotalAsMoney
Money
Gets the handling total as a Money object. Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# insuranceTotalAsMoney
Money
Gets the insurance total as a Money object. Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# discountTotalAsMoney
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# taxTotalAsMoney
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# surchargeTotalAsMoney
Money
Gets the surcharge total as a Money object. Represents the surcharge total.
# totalAsMoney
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# invoices
Collection
Get all invoices linked to this order (Order, Checkout)
# currencyCode
string
Get currency code
# id
?int
# uuid
?string
# comments
?string
# data
?array
# appliedDiscounts
array
Metadata of the applied discounts.
# discountCodes
array
List of the applied discount codes.
# shippingTotal
?string
Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# handlingTotal
?string
Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# insuranceTotal
?string
Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# discountTotal
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# taxTotal
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# surchargeTotal
?string
Represents the surcharge total.
# total
?string
Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# created
?DateTime
Date the record was created.
# modified
?DateTime
Last modification date for the record.
# billingAddress
?Address
# deliveryAddress
?Address
# currency
?Currency
# person
?Person
# site
?Site
# items
?Collection<Item>
# messages
?Collection<Message>
# fulfillments
?Collection<Fulfillment>
# metadataFieldValues
?Collection<MetadataFieldValue>
# sourceEntity
?string
Get the source record entity
# sourceUuid
?string
Get the source record uuid
# discountLogs
?Collection<Log>
# externalId
?string

Admin view

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

Properties 58

Take no arguments.

# getFulfillmentStatusLabels()
array
Gets all available fulfillment statuses with their labels
# getFulfillmentStatusDisplay()
string
Gets fulfillment status display label
# getFinancialStatusLabels()
array
Gets all available financial statuses with their labels
# getFulfillmentStatusSummary()
string
The fulfillment status as the orders list shows it: its label, followed by "Backorder" while a fulfillment of the order waits for stock - "Pending · Backorder" Read from the order's own columns, so the list does not load the fulfillments of each row. On the shared model because the admin's list loads its rows through the API.
# getFinancialStatusDisplay()
string
Gets financial status display label
# getRefundedTotalAsMoney()
Money
Get the amount refunded
# getPendingRefundTotalAsMoney()
Money
Get the amount of refunds the payment service has not yet completed or failed
# getRefundableTotalAsMoney()
Money
Get the amount still available to refund. Pending refunds are held back as well as completed ones, so a second refund cannot claim money that is already being returned.
# isRefundable()
bool
Is the order refundable?
# getEditUrl() Not in Templates
?string
Get the url for editing the record.
# getNumber()
?string
# getOrdered()
?DateTime
The time which order was placed
# getFinancialStatus()
?string
Set the financial status of the order. Values include: unpaid, authorized, partially_paid, paid, partially_refunded, refunded, voided.
# getFulfillmentStatus()
?string
Set the fulfillment status of the order. Values include: none, pending, partial, fulfilled, completed.
# getHasBackorder()
?bool
Whether a fulfillment of the order waits for stock
# getRefunds()
?Collection<Refund>
# getItemTotalAsMoney()
Money
Gets the item total as a Money object. Represents the sum of all items' Amount values.
# getShippingTotalAsMoney()
Money
Gets the shipping total as a Money object. Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotalAsMoney()
Money
Gets the handling total as a Money object. Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotalAsMoney()
Money
Gets the insurance total as a Money object. Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotalAsMoney()
Money
Gets the discount total as a Money object. Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotalAsMoney()
Money
Gets the tax total as a Money object. Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotalAsMoney()
Money
Gets the surcharge total as a Money object. Represents the surcharge total.
# getTotalAsMoney()
Money
Gets the grand total as a Money object. Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getInvoices()
Collection
Get all invoices linked to this order (Order, Checkout)
# getCurrencyCode()
string
Get currency code
# getId()
?int
# getUuid()
?string
# getComments()
?string
# getData()
?array
# getAppliedDiscounts()
array
Metadata of the applied discounts.
# getDiscountCodes()
array
List of the applied discount codes.
# getShippingTotal()
?string
Represents the net shipping total. Tax and discount on shipping are tracked in Tax Total and Discount Total.
# getHandlingTotal()
?string
Represents the net handling total. Tax and discount on handling are tracked in Tax Total and Discount Total.
# getInsuranceTotal()
?string
Represents the net insurance total. Tax and discount on insurance are tracked in Tax Total and Discount Total.
# getDiscountTotal()
?string
Represents the sum of discount values across all line items, including shipping, handling, etc.
# getTaxTotal()
?string
Represents the sum of tax values across all line items, including shipping, handling, etc.
# getSurchargeTotal()
?string
Represents the surcharge total.
# getTotal()
?string
Represents the final value calculated as Item Total + Shipping Total + Handling Total + Insurance Total - Discount Total + Tax Total + Surcharge Total.
# getCreated()
?DateTime
Date the record was created.
# getModified()
?DateTime
Last modification date for the record.
# getBillingAddress()
?Address
# getDeliveryAddress()
?Address
# getCurrency()
?Currency
# getPerson()
?Person
# getSite()
?Site
# getItems()
?Collection<Item>
# getMessages()
?Collection<Message>
# getFulfillments()
?Collection<Fulfillment>
# getMetadataFieldValues()
?Collection<MetadataFieldValue>
# getSourceEntity()
?string
Get the source record entity
# getSourceUuid()
?string
Get the source record uuid
# getDiscountLogs()
?Collection<Log>
# getExternalId()
?string
# getUnassignedItems() Admin only
array
The order's items, or the part of each item's quantity, that no active fulfillment covers Derived from quantities, so nothing is stored: the item's quantity minus what its lines in non-cancelled fulfillments hold. The items of a cancelled fulfillment come back here until they are placed again, and so does anything a fulfillment never included.
# isDeliveredDigitally() Admin only
bool
Whether the order had nothing to ship and is complete: it has fulfillments, and every one has a nothing-to-ship method and is delivered The order page then lists the items without fulfillment tracking - no fulfillment badge, cards or packing slips. An order still waiting on one of them keeps its cards, so an admin can mark it delivered; so does one with a cancelled fulfillment, whose items are unassigned and need placing again. Iterates the order's fulfillments, so it must not be called from inside a loop over them.
# getDeliveredDigitallyAt() Admin only
?DateTime
When the order's nothing-to-ship fulfillments were delivered: the latest of their delivered times Iterates the order's fulfillments, so it must not be called from inside a loop over them.

Methods 2

Take arguments. The API serialises only getters that need none.

# hasModelMethod(string $methodName) Admin only
bool
# get(string $propertyName, array $parameters) Admin only
void