Change log

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

Parameter
Values
Required
Description
type
orders

This is the name of the entity that needs to be used for the component retrieving function.

viewType
list (default)
detail

Outputs a subset of data when viewType is `list` and more data related to the item when set to `detail`. This is to help with performance when listing many items and where not all data is required for output.
layout
<path/to/layout>

Path to file that will contain the Liquid layout content to be parsed.

If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).

currentMemberOnly
true (default)
false

By default (true) retrieves orders from the logged in user only. If false retrieves orders for all CRM contacts.
filterBy
id
formId
memberId
caseId
name
invoiceNumber
invoiceDate
paymentType
AmountPaid
subTotalPrice
taxRate
taxPrice
totalPrice

The name of the property to filter by. If empty or not present, no filtering will be used.

Remove spaces from custom property names here.

filterValue
<your value>

Your specific value to filter by, eg: name, id, number, date, etc.
Liquid variables can be used here also. If present but no value set, no items will be returned.
filterCondition
equally (default)
less
more
lessequally
moreequally
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.

sortBy
id
formId
memberId
caseId
name
invoiceNumber
invoiceDate (default)
paymentType
AmountPaid
subTotalPrice
taxRate
taxPrice
totalPrice

The name of the property to sort by. If empty or not present, alpha/numeric sorting will be used.

Remove spaces from custom property names here.

sortOrder
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.
limit
10 (default)
<integer>

The maximum number of items returned (unspecified parameter will show ALL items).
offset
0 (default)
<number>

The number of items skipped before being listed.
object
item
collection (default)

Determines the method for Liquid rendering.
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).
collectionVariable
<yourLiquidVariableName>

Assigns the data to a Liquid collection enabling further access to the data on the Page or Template using Liquid.

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.

ViewType: List

{
  "Items": [
    {
      "CustomerEmail": "joetest@test.com",
      "CustomerEmailToLower": "joetest@test.com",
      "PaymentType": "CreditCard",
      "State": "Paid",
      "Name": "Checkout 09 Aug 2020 12:34 AM",
      "NameToLower": "checkout 09 aug 2020 12:34 am",
      "InvoiceNumber": 2,
      "InvoiceNumberToLower": "2",
      "AmountPaid": 44.4700,
      "InvoiceCode": "2",
      "InvoiceCodeToLower": "2",
      "InvoiceDate": "2020-08-08T23:34:56.65",
      "AWBNumber": null,
      "TrackingURL": null,
      "OrderState": "Paid",
      "IsRecurring": false,
      "HasActiveSubscription": false,
      "PaymentIntentId": "pi_1HE7BK433Ww5sV49pETlcTWq",
      "PaymentIntentClientSecret": "pi_1HE7BK433Ww5sV49pETlcTWq_secret_EvfgOKQMlaUPMKe5ZXZU2zMhZ",
      "SubTotalPrice": 41.9500,
      "TaxRate": 0.0600,
      "DiscountPrice": 0.0,
      "TotalPrice": 44.4670,
      "GiftVoucherPrice": 0.0,
      "TaxCode": "IA",
      "TaxPrice": 2.5170,
      "AddressLine": "1 street",
      "ShippingCity": "streetville",
      "ShippingState": "NSW",
      "ShippingZipCode": "2000",
      "ShippingCountry": "UNITED STATES",
      "AmountPending": 0.0,
      "FormId": "1385",
      "MemberId": "1430",
      "CaseId": "1479",
      "MainOrderId": null,
      "ShippingAddress": {
        "AddressLine": "1 street",
        "City": "streetville",
        "State": "NSW",
        "ZipCode": "2000",
        "Country": "UNITED STATES"
      },
      "AmountPaidHtml": "<span data-cms_cart_total=\"3727\">$44.47</span>",
      "AmountPendingHtml": "<span data-cms_cart_total=\"3727\">$0.00</span>",
      "Id": "3727",
      "TaxPercent": 6.0000,
      "ShippingPrice": 0.0,
      "ShippingTaxRate": 0.0,
      "ShippingTaxPrice": 0.0,
      "ShippingSubTotalPrice": 0.0,
      "ShippingTotalPrice": 0.0,
      "SubTotalTaxPrice": 2.51700000,
      "DiscountedSubTotalTaxPrice": 2.51700000,
      "GrandTotalPrice": 44.46700000,
      "TotalPriceExcludingTax": 41.9500,
      "TotalPriceExcludingTaxAndGiftVoucherAmount": 41.9500,
      "DiscountPriceExcludingTax": 0.0,
      "ShippingOption": {
        "Id": "3546",
        "ShippingOptionId": "3544",
        "Name": "Pick-up in Store",
        "Price": 0.0,
        "TaxPercent": 0.0,
        "TaxRate": 0.0,
        "TaxPrice": 0.0,
        "TotalPrice": 0.0,
        "SubTotalPrice": 0.0
      },
      "FormatSetting": {
        "Id": "2230",
        "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"
      },
      "Discount": null,
      "GiftVoucher": null,
      "TotalPriceExcludingTaxHtml": "<span data-cms_cart_total_price_excluding_tax=\"3727\">$41.95</span>",
      "TotalPriceExcludingTaxAndGiftVoucherAmountHtml": "<span data-cms_cart_total_price_excluding_tax_and_gift_voucher_amount=\"3727\">$41.95</span>",
      "GrandTotalPriceHtml": "<span data-cms_cart_grand_total_price=\"3727\">$44.47</span>",
      "DiscountPriceHtml": "<span data-cms_cart_discount_price=\"3727\">$0.00</span>",
      "DiscountedSubTotalTaxPriceHtml": "<span data-cms_cart_discounted_sub_total_tax_price=\"3727\">$2.52</span>",
      "SubTotalTaxPriceHtml": "<span data-cms_cart_subtotal_tax_price=\"3727\">$2.52</span>",
      "TaxPriceHtml": "<span data-cms_cart_tax_price=\"3727\">$2.52</span>",
      "ShippingTotalPriceHtml": "<span data-cms_cart_shipping_total_price=\"3727\">$0.00</span>",
      "ShippingPriceHtml": "<span data-cms_cart_shipping_price=\"3727\">$0.00</span>",
      "ShippingTaxPriceHtml": "<span data-cms_cart_shipping_tax_price=\"3727\">$0.00</span>",
      "ShippingTaxPercentHtml": "<span data-cms_cart_shipping_tax_percent=\"3727\">0%</span>",
      "TaxPercentHtml": "<span data-cms_cart_tax_percent=\"3727\">6.0000%</span>",
      "GiftVoucherPriceHtml": "<span data-cms_cart_gift_voucher_price=\"3727\">$0.00</span>",
      "TotalPriceHtml": "<span data-cms_cart_total=\"3727\">$44.47</span>",
      "Items": [
        {
          "EcommerceItemId": 0,
          "SmallImage": "/images/template-detail-dinewine-mobile@2x.png",
          "Name": "DEMO Product 1",
          "SKUCode": "DEMO1",
          "Quantity": 1,
          "ModuleItemUrl": null,
          "TaxCode": null,
          "OnSale": false,
          "Price": 39.9500,
          "TaxRate": 0.0600,
          "UnitPrice": 41.9500,
          "RecommendedPrice": 0.0,
          "IsDownloadable": false,
          "WebDomain": "webinone-docs-v6.treepl.co",
          "Attributes": [
            {
              "Name": "Size",
              "AttributeTypeInt": 0,
              "ValueTypeInt": 0,
              "TaxRate": 0.0600,
              "Price": 2.0000,
              "Id": "3664",
              "AttributeType": "0",
              "ValueType": "FixedPrice",
              "SubTotalPrice": 2.0000,
              "TaxPercent": 6.0000,
              "TaxPrice": 0.12000000,
              "TotalPrice": 2.12000000,
              "Options": [
                {
                  "Name": "Medium",
                  "Price": 2.0000,
                  "TaxRate": 0.0600,
                  "Image": "/images/template-crafter@2x.jpg",
                  "Id": "3657"
                }
              ]
            }
          ],
          "Id": "3704",
          "ProductFileLink": "",
          "Url": null,
          "TaxPercent": 6.0000,
          "TaxPrice": 2.51700000,
          "TotalPrice": 44.46700000,
          "UnitTaxPrice": 2.51700000,
          "UnitTotalPrice": 44.46700000,
          "UnitRecommendedTaxPrice": 0.0,
          "UnitRecommendedTotalPrice": 0.0,
          "UnitRecommendedPrice": 0.0,
          "TotalPriceExcludingTax": 41.9500,
          "TaxPercentHtml": "<span data-cms_cart_item_tax_percent=\"3704\">6.0000%</span>",
          "TotalPriceExcludingTaxHtml": "<span data-cms_cart_item_total_without_tax=\"3704\">$41.95</span>",
          "UnitTaxPriceHtml": "<span data-cms_cart_item_unit_tax=\"3704\">$2.52</span>",
          "UnitTotalPriceHtml": "<span data-cms_cart_item_total_unit_price=\"3704\">$44.47</span>",
          "UnitPriceHtmlTotal": "<span data-cms_cart_item_total_unit_price=\"3704\">$44.47</span>",
          "PriceHtml": "<span data-cms_cart_item_price=\"3704\">$39.95</span>",
          "UnitPriceHtml": "<span data-cms_cart_item_subtotal_price=\"3704\">$41.95</span>",
          "TaxPriceHtml": "<span data-cms_cart_item_tax=\"3704\">$2.52</span>",
          "TotalPriceHtml": "<span data-cms_cart_item_total_price=\"3704\">$44.47</span>",
          "QuantityHtml": "<input type=\"number\" value=\"1\" data-cms_cart_item_quantity=\"3704\" />",
          "RemoveHtml": "<a href=\"javascript:\" data-cms_cart_remove_order_line=\"3704\"><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=\"3704\"></span>",
          "UnitRecommendedPriceHtml": "<span data-cms_cart_unit_recommended_price_html=\"3704\">$0.00</span>",
          "UnitRecommendedTaxPriceHtml": "<span data-cms_cart_unit_recommended_tax_price_html=\"3704\">$0.00</span>",
          "UnitRecommendedTotalPriceHtml": "<span data-cms_cart_unit_recommended_total_price_html=\"3704\">$0.00</span>"
        }
      ],
      "SubTotalPriceHtml": "<span data-cms_cart_subtotal=\"3727\">$41.95</span>",
      "TaxCodeHtml": "<span data-cms_cart_tax_code_html=\"3727\">IA</span>",
      "Params": {}
    }
  ],
  "Params": {
    "type": "orders",
    "currentmemberonly": "false",
    "collectionvariable": "allorders",
    "layout": "",
    "filterby": "memberId",
    "filtervalue": "1430",
    "viewtype": "list"
  }
}

ViewType: Detail

{
  "Items": [
    {
      "CustomerEmail": "joetest@test.com",
      "CustomerEmailToLower": "joetest@test.com",
      "PaymentType": "CreditCard",
      "State": "Paid",
      "Name": "Checkout 09 Aug 2020 12:34 AM",
      "NameToLower": "checkout 09 aug 2020 12:34 am",
      "InvoiceNumber": 2,
      "InvoiceNumberToLower": "2",
      "AmountPaid": 44.4700,
      "InvoiceCode": "2",
      "InvoiceCodeToLower": "2",
      "InvoiceDate": "2020-08-08T23:34:56.65",
      "AWBNumber": null,
      "TrackingURL": null,
      "OrderState": "Paid",
      "IsRecurring": false,
      "HasActiveSubscription": false,
      "PaymentIntentId": "pi_1HE7BK433Ww5sV49pETlcTWq",
      "PaymentIntentClientSecret": "pi_1HE7BK433Ww5sV49pETlcTWq_secret_EvfgOKQMlaUPMKe5ZXZU2zMhZ",
      "SubTotalPrice": 41.9500,
      "TaxRate": 0.0600,
      "DiscountPrice": 0.0,
      "TotalPrice": 44.4670,
      "GiftVoucherPrice": 0.0,
      "TaxCode": "IA",
      "TaxPrice": 2.5170,
      "AddressLine": "1 street",
      "ShippingCity": "streetville",
      "ShippingState": "NSW",
      "ShippingZipCode": "2000",
      "ShippingCountry": "UNITED STATES",
      "AmountPending": 0.0,
      "FormId": "1385",
      "MemberId": "1430",
      "CaseId": "1479",
      "MainOrderId": null,
      "ShippingAddress": {
        "AddressLine": "1 street",
        "City": "streetville",
        "State": "NSW",
        "ZipCode": "2000",
        "Country": "UNITED STATES"
      },
      "AmountPaidHtml": "<span data-cms_cart_total=\"3727\">$44.47</span>",
      "AmountPendingHtml": "<span data-cms_cart_total=\"3727\">$0.00</span>",
      "Id": "3727",
      "TaxPercent": 6.0000,
      "ShippingPrice": 0.0,
      "ShippingTaxRate": 0.0,
      "ShippingTaxPrice": 0.0,
      "ShippingSubTotalPrice": 0.0,
      "ShippingTotalPrice": 0.0,
      "SubTotalTaxPrice": 2.51700000,
      "DiscountedSubTotalTaxPrice": 2.51700000,
      "GrandTotalPrice": 44.46700000,
      "TotalPriceExcludingTax": 41.9500,
      "TotalPriceExcludingTaxAndGiftVoucherAmount": 41.9500,
      "DiscountPriceExcludingTax": 0.0,
      "ShippingOption": {
        "Id": "3546",
        "ShippingOptionId": "3544",
        "Name": "Pick-up in Store",
        "Price": 0.0,
        "TaxPercent": 0.0,
        "TaxRate": 0.0,
        "TaxPrice": 0.0,
        "TotalPrice": 0.0,
        "SubTotalPrice": 0.0
      },
      "FormatSetting": {
        "Id": "2230",
        "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"
      },
      "Discount": null,
      "GiftVoucher": null,
      "TotalPriceExcludingTaxHtml": "<span data-cms_cart_total_price_excluding_tax=\"3727\">$41.95</span>",
      "TotalPriceExcludingTaxAndGiftVoucherAmountHtml": "<span data-cms_cart_total_price_excluding_tax_and_gift_voucher_amount=\"3727\">$41.95</span>",
      "GrandTotalPriceHtml": "<span data-cms_cart_grand_total_price=\"3727\">$44.47</span>",
      "DiscountPriceHtml": "<span data-cms_cart_discount_price=\"3727\">$0.00</span>",
      "DiscountedSubTotalTaxPriceHtml": "<span data-cms_cart_discounted_sub_total_tax_price=\"3727\">$2.52</span>",
      "SubTotalTaxPriceHtml": "<span data-cms_cart_subtotal_tax_price=\"3727\">$2.52</span>",
      "TaxPriceHtml": "<span data-cms_cart_tax_price=\"3727\">$2.52</span>",
      "ShippingTotalPriceHtml": "<span data-cms_cart_shipping_total_price=\"3727\">$0.00</span>",
      "ShippingPriceHtml": "<span data-cms_cart_shipping_price=\"3727\">$0.00</span>",
      "ShippingTaxPriceHtml": "<span data-cms_cart_shipping_tax_price=\"3727\">$0.00</span>",
      "ShippingTaxPercentHtml": "<span data-cms_cart_shipping_tax_percent=\"3727\">0%</span>",
      "TaxPercentHtml": "<span data-cms_cart_tax_percent=\"3727\">6.0000%</span>",
      "GiftVoucherPriceHtml": "<span data-cms_cart_gift_voucher_price=\"3727\">$0.00</span>",
      "TotalPriceHtml": "<span data-cms_cart_total=\"3727\">$44.47</span>",
      "Items": [
        {
          "EcommerceItemId": 0,
          "SmallImage": "/images/template-detail-dinewine-mobile@2x.png",
          "Name": "DEMO Product 1",
          "SKUCode": "DEMO1",
          "Quantity": 1,
          "ModuleItemUrl": null,
          "TaxCode": null,
          "OnSale": false,
          "Price": 39.9500,
          "TaxRate": 0.0600,
          "UnitPrice": 41.9500,
          "RecommendedPrice": 0.0,
          "IsDownloadable": false,
          "WebDomain": "webinone-docs-v6.treepl.co",
          "Attributes": [
            {
              "Name": "Size",
              "AttributeTypeInt": 0,
              "ValueTypeInt": 0,
              "TaxRate": 0.0600,
              "Price": 2.0000,
              "Id": "3664",
              "AttributeType": "0",
              "ValueType": "FixedPrice",
              "SubTotalPrice": 2.0000,
              "TaxPercent": 6.0000,
              "TaxPrice": 0.12000000,
              "TotalPrice": 2.12000000,
              "Options": [
                {
                  "Name": "Medium",
                  "Price": 2.0000,
                  "TaxRate": 0.0600,
                  "Image": "/images/template-crafter@2x.jpg",
                  "Id": "3657"
                }
              ]
            }
          ],
          "Id": "3704",
          "ProductFileLink": "",
          "Url": null,
          "TaxPercent": 6.0000,
          "TaxPrice": 2.51700000,
          "TotalPrice": 44.46700000,
          "UnitTaxPrice": 2.51700000,
          "UnitTotalPrice": 44.46700000,
          "UnitRecommendedTaxPrice": 0.0,
          "UnitRecommendedTotalPrice": 0.0,
          "UnitRecommendedPrice": 0.0,
          "TotalPriceExcludingTax": 41.9500,
          "TaxPercentHtml": "<span data-cms_cart_item_tax_percent=\"3704\">6.0000%</span>",
          "TotalPriceExcludingTaxHtml": "<span data-cms_cart_item_total_without_tax=\"3704\">$41.95</span>",
          "UnitTaxPriceHtml": "<span data-cms_cart_item_unit_tax=\"3704\">$2.52</span>",
          "UnitTotalPriceHtml": "<span data-cms_cart_item_total_unit_price=\"3704\">$44.47</span>",
          "UnitPriceHtmlTotal": "<span data-cms_cart_item_total_unit_price=\"3704\">$44.47</span>",
          "PriceHtml": "<span data-cms_cart_item_price=\"3704\">$39.95</span>",
          "UnitPriceHtml": "<span data-cms_cart_item_subtotal_price=\"3704\">$41.95</span>",
          "TaxPriceHtml": "<span data-cms_cart_item_tax=\"3704\">$2.52</span>",
          "TotalPriceHtml": "<span data-cms_cart_item_total_price=\"3704\">$44.47</span>",
          "QuantityHtml": "<input type=\"number\" value=\"1\" data-cms_cart_item_quantity=\"3704\" />",
          "RemoveHtml": "<a href=\"javascript:\" data-cms_cart_remove_order_line=\"3704\"><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=\"3704\"></span>",
          "UnitRecommendedPriceHtml": "<span data-cms_cart_unit_recommended_price_html=\"3704\">$0.00</span>",
          "UnitRecommendedTaxPriceHtml": "<span data-cms_cart_unit_recommended_tax_price_html=\"3704\">$0.00</span>",
          "UnitRecommendedTotalPriceHtml": "<span data-cms_cart_unit_recommended_total_price_html=\"3704\">$0.00</span>"
        }
      ],
      "SubTotalPriceHtml": "<span data-cms_cart_subtotal=\"3727\">$41.95</span>",
      "TaxCodeHtml": "<span data-cms_cart_tax_code_html=\"3727\">IA</span>",
      "Params": {}
    }
  ],
  "Params": {
    "type": "orders",
    "currentmemberonly": "false",
    "collectionvariable": "allordersDetail",
    "layout": "",
    "filterby": "memberId",
    "filtervalue": "1430",
    "viewtype": "detail"
  }
}

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 09 Aug 2020 12:34 AM Invoice Date: Saturday, August 08, 2020 Total Cost: $44.47

Accessing the Data

JSON Output

You can output the full JSON for your component data by referencing the root Liquid object {{this}} in your module’s layouts, or directly on your page, if using the collectionVariable parameter in your component tag.

For example:

{% component type: ... collectionVariable: "myData" %}

You can then render the JSON like so:

{{myData}}

For more details on using this approach, see Part 2 of the free ‘Learning Liquid Course’.

Rendering Property Values

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 09 Aug 2020 12:34 AM

{{allorders.items[0]['name']}}


Related Articles

  • Reports
    Custom Reports

    Custom reports can be used to bring CRM data together, as a spreadsheet, based on your requirements.
  • CRM
    Form Submissions

    Form Submissions store the captured data from any form submission made on your website (from a form created under ‘Content’ > ‘Forms’).
  • CRM
    Advanced CRM Groups

    Advanced CRM Groups allow you to extend the data fields within multiple areas of the CRM, either globally or on a per-record basis.
  • Liquid Objects & Usage
    {{ workflow }} object

    This liquid object will output the Workflow details of a submitted Form. You can use...
  • Liquid Components
    CRMCustomGroup

    This component fetches Advanced CRM Group data attached to CRM Records, Cases, Orders or Event Bookings.
  • Liquid Components
    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@webinone.com and we will consult you as soon as possible.