orders
This component fetches Orders from the CRM, either owned by the logged-in user or for all customer Orders.
{% component type: "orders" %}
Parameters and Options
orders
This is the name of the entity that needs to be used for the component retrieving function.
<path/to/layout>
If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).
true (default)
false
true
) retrieves orders from the logged in user only. If false
retrieves orders for all CRM contacts.id (default)
formId
memberId
caseId
name
invoiceNumber
invoiceDate
paymentType
AmountPending
AmountPaid
subTotalPrice
taxPercent
taxPrice
totalPrice
Remove spaces from custom property names here.
<your value>
Liquid variables can be used here also. If present but no value set, no items will be returned.
equally (default)
less
more
lessequally
moreequaly
contains
The condition in which to filter by. For example filtering Case from, and including, a specific date you could filterBy DateSubmission
with a filterValue of date 2020-03-02
and a filterCondition moreEqually
.
id (default)
formId
memberId
caseId
name
invoiceNumber
invoiceDate
paymentType
AmountPending
AmountPaid
subTotalPrice
taxPercent
taxPrice
totalPrice
Remove spaces from custom property names here.
ASC
DESC (default)
ASC
sorts the items in ascending order while DESC
sorts in descending order (based on alpha/numeric or date sorting).If empty or not present, alpha/numeric sorting will be used.
10 (default)
<number>
0 (default)
<number>
item
collection (default)
item
returns each item iteratively, one after another, for output (generally, output to a container element with no need for looping through the data).collection
returns all items as one collection for output (your container element and looping logic would be handled in the Components Layout).<yourLiquidVariableName>
Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.
Liquid Output
The below example has 1 sample items
(due to a filter
applied) but is otherwise the default structure you will get from this Component.
{
"items": [
{
"customerEmail": "testt3606@gmail.com",
"paymentType": "CreditCard",
"state": "Paid",
"formId": 13,
"memberId": 35,
"caseId": 186,
"name": "Checkout 12 May 2020 09:01 AM",
"invoiceNumber": 1,
"invoiceCode": "1",
"invoiceDate": "2020-05-12T09:01:00.24",
"shippingAddress": {
"addressLine": "1 Test Street",
"city": "Testville",
"state": "LA",
"zipCode": "2323",
"country": "UNITED STATES"
},
"amountPending": 0.0000,
"amountPaid": 12.4800,
"amountPaidHtml": "<span data-cms_cart_total=\"12877807959236673571\">$12.48</span>",
"amountPendingHtml": "<span data-cms_cart_total=\"12877807959236673571\">$0.00</span>",
"awbNumber": null,
"trackingUrl": null,
"id": "12877807959236673571",
"paymentIntentId": null,
"paymentIntentClientSecret": null,
"formatSetting": {
"name": "Default",
"culture": "en-US",
"decimalsQuantity": 2,
"currency": {
"code": "USD",
"symbol": "$",
"digitalCode": "840",
"name": "US Dollar"
}
},
"domainCountry": {
"name": "UNITED STATES",
"code": "US"
},
"destinationCountry": {
"name": "UNITED STATES",
"code": "US"
},
"shippingOption": {
"id": "12252410371037462531",
"shippingOptionId": "7361027874612051969",
"name": "Local Delivery",
"price": 10.0000,
"taxPercent": 4.0000,
"taxRate": 0.0400,
"taxPrice": 0.0,
"totalPrice": 10.00,
"subTotalPrice": 10.00
},
"discount": {
"id": null,
"code": null,
"type": null,
"amount": 0.0
},
"giftVoucher": {
"id": null,
"code": null,
"amount": 0.0,
"balance": 0.0
},
"subTotalPrice": 2.0800,
"taxPercent": 4.0000,
"taxRate": 0.0400,
"taxPrice": 0.0800,
"discountPrice": 0.0000,
"totalPrice": 12.4800,
"shippingPrice": 10.0000,
"shippingTaxRate": 0.0400,
"shippingTaxPrice": 0.0,
"shippingSubTotalPrice": 10.00,
"shippingTotalPrice": 10.00,
"giftVoucherPrice": 0.0000,
"subTotalTaxPrice": -2.0000,
"discountedSubTotalTaxPrice": -2.0000,
"grandTotalPrice": 0.0800,
"totalPriceExcludingTax": 12.4000,
"totalPriceExcludingTaxAndGiftVoucherAmount": 12.0800,
"taxCode": "LA",
"totalPriceExcludingTaxHtml": "<span data-cms_cart_total_price_excluding_tax=\"12877807959236673571\">$12.40</span>",
"totalPriceExcludingTaxAndGiftVoucherAmountHtml": "<span data-cms_cart_total_price_excluding_tax_and_gift_voucher_amount=\"12877807959236673571\">$12.08</span>",
"grandTotalPriceHtml": "<span data-cms_cart_grand_total_price=\"12877807959236673571\">$0.08</span>",
"discountPriceHtml": "<span data-cms_cart_discount_price=\"12877807959236673571\">$0.00</span>",
"discountedSubTotalTaxPriceHtml": "<span data-cms_cart_discounted_sub_total_tax_price=\"12877807959236673571\">($2.00)</span>",
"subTotalTaxPriceHtml": "<span data-cms_cart_subtotal_tax_price=\"12877807959236673571\">($2.00)</span>",
"taxPriceHtml": "<span data-cms_cart_tax_price=\"12877807959236673571\">$0.08</span>",
"shippingTotalPriceHtml": "<span data-cms_cart_shipping_total_price=\"12877807959236673571\">$10.00</span>",
"shippingPriceHtml": "<span data-cms_cart_shipping_price=\"12877807959236673571\">$10.00</span>",
"shippingTaxPriceHtml": "<span data-cms_cart_shipping_tax_price=\"12877807959236673571\">$0.00</span>",
"shippingTaxPercentHtml": "<span data-cms_cart_shipping_tax_percent=\"12877807959236673571\">4.0000%</span>",
"taxPercentHtml": "<span data-cms_cart_tax_percent=\"12877807959236673571\">4.0000%</span>",
"giftVoucherPriceHtml": "<span data-cms_cart_gift_voucher_price=\"12877807959236673571\">$0.00</span>",
"totalPriceHtml": "<span data-cms_cart_total=\"12877807959236673571\">$12.48</span>",
"items": [
{
"id": "15049017874163171329",
"ecommerceItemId": 0,
"smallImage": "/images/template-detail-dinewine-mobile@2x.png",
"name": "DEMO Product 1",
"type": null,
"moduleId": 0,
"SKUCode": "DEMO1",
"quantity": 1,
"productFileLink": null,
"Url": null,
"taxCode": "LA",
"onSalse": false,
"price": 0.0000,
"taxPercent": 4.0000,
"unitPrice": 2.0000,
"taxPrice": -2.0000,
"unitTotalPrice": 0.0,
"totalPrice": 0.0,
"unitTaxPrice": 0.08000000,
"taxRate": 0.0400,
"totalPriceExcludingTax": 2.0000,
"unitRecommendedPrice": 0.0,
"unitRecommendedTaxPrice": 0.0,
"unitRecommendedTotalPrice": 0.0,
"taxPercentHtml": "<span data-cms_cart_item_tax_percent=\"15049017874163171329\">4.0000%</span>",
"totalPriceExcludingTaxHtml": "<span data-cms_cart_item_total_without_tax=\"15049017874163171329\">$2.00</span>",
"unitTaxPriceHtml": "<span data-cms_cart_item_unit_tax=\"15049017874163171329\">$0.08</span>",
"unitTotalPriceHtml": "<span data-cms_cart_item_total_unit_price=\"15049017874163171329\">$0.00</span>",
"unitPriceHtmlTotal": "<span data-cms_cart_item_total_unit_price=\"15049017874163171329\">$0.00</span>",
"priceHtml": "<span data-cms_cart_item_price=\"15049017874163171329\">$0.00</span>",
"unitPriceHtml": "<span data-cms_cart_item_subtotal_price=\"15049017874163171329\">$2.00</span>",
"taxPriceHtml": "<span data-cms_cart_item_tax=\"15049017874163171329\">($2.00)</span>",
"totalPriceHtml": "<span data-cms_cart_item_total_price=\"15049017874163171329\">$0.00</span>",
"quantityHtml": "<input type=\"number\" value=\"1\" data-cms_cart_item_quantity=\"15049017874163171329\" />",
"removeHtml": "<a href=\"javascript:\" data-cms_cart_remove_order_line=\"15049017874163171329\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" /><path d=\"M0 0h24v24H0z\" fill=\"none\" /></svg></a>",
"taxCodeHtml": "<span data-cms_cart_tax_code_html=\"15049017874163171329\">LA</span>",
"unitRecommendedPriceHtml": "<span data-cms_cart_unit_recommended_price_html=\"15049017874163171329\">$0.00</span>",
"unitRecommendedTaxPriceHtml": "<span data-cms_cart_unit_recommended_tax_price_html=\"15049017874163171329\">$0.00</span>",
"unitRecommendedTotalPriceHtml": "<span data-cms_cart_unit_recommended_total_price_html=\"15049017874163171329\">$0.00</span>",
"attributes": [
{
"id": "12550665647534637058",
"name": "Size",
"attributeType": "0",
"valueType": "FixedPrice",
"options": [
{
"id": "749807479205920772",
"name": "Medium",
"price": 2.0000,
"taxPercent": 4.0000,
"taxPrice": 8.00000000,
"image": "/images/template-crafter@2x.jpg",
"totalPrice": 10.00000000
}
],
"subTotalPrice": 2.0000,
"taxPercent": 4.0000,
"taxPrice": 8.00000000,
"price": 2.0000,
"totalPrice": 10.00000000
}
]
}
],
"subTotalPriceHtml": "<span data-cms_cart_subtotal=\"12877807959236673571\">$2.08</span>",
"taxCodeHtml": "<span data-cms_cart_tax_code_html=\"12877807959236673571\">LA</span>"
}
],
"Params": {
"type": "orders",
"collectionVariable": "allorders",
"layout": "",
"filterBy": "memberId",
"filterValue": "35"
}
}
Virtual Layout
Based on the above example, if not using any custom layout or collection, the default virtual layout will output as a summary list of orders, eg:
<ul>
{% for order in this.items %}
<li>
<strong>{{order .name}}</strong>
<span>Invoice Date: {{order.invoiceDate | format_date: "dddd, MMMM dd, yyyy"}}</span>
<span>Total Cost: {{order.totalPrice | set_money_format : order.domainCountryCode, order.formatSettingId}}</span>
</li>
{% endfor %}
</ul>
Rendering the list:
- Checkout 12 May 2020 09:01 AM Invoice Date: Tuesday, May 12, 2020 Total Cost: $12.48
Accessing the Data
This data is also accessible directly on the Page or Template via a Liquid Collection by adding collectionVariable
to the Component.
An example using collectionVariable
with value "allorders":
{% component type: "orders", collectionVariable: "allorders" %}
Accessing a specific item within the collection. In this case the first item (zero based index), which in our example would render the value Checkout 12 May 2020 09:01 AM
{{allorders.items[0]['name']}}
Related Articles
- Custom Reports
- Form Submissions
- {{ workflow }} object
This liquid object will output the Workflow details of a submitted Form. You can use... - Advanced CRM Groups
- CRMCustomGroup
This component fetches Advanced CRM Group data attached to CRM Records, Cases, Orders or Event Bookings. - cases
This component fetches Cases from the CRM, either owned by the logged-in user or for all customer Cases.
External Resources
There are currently no external resources available.
Please let us know if you have any other contributions or know of any helpful resources you'd like to see added here.
Questions?
We are always happy to help with any questions you may have.
Visit the Treepl Forum for community support and to search previously asked questions or send us a message at support@treepl.co and we will consult you as soon as possible.