Change log


This component renders a form input element allowing a quantity to be set for when the source item is added to the shopping cart.

{% component type: "ecommerce_item_quantity", itemId: "<Item ID>" %}

Parameters and Options


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

<Item ID>
The module item ID (specific Product) the data is to be sourced from

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).


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 shows the output data for the specified item ID. The Liquid data output from this example would look like the following (for example, when using a collectionVariable to create the collection):

  "Id": 2535,
  "Name": "DEMO Product 1",
  "Url": "/catalogs/demo-product-1",
  "Url_List": [
  "UrlSlug": "demo-product-1",
  "ParentId": 2485,
  "ParentId_List": [
  "ParentName": "",
  "ParentUrl": "",
  "TemplateName": "",
  "Module_Alias": "Product",
  "Module_ID": 2485,
  "Enabled": true,
  "ReleaseDate": "2020-05-04T23:00:00",
  "ExpiryDate": "2099-12-11T13:00:00",
  "SiteSearchKeywords": [
  "Description": "<p>Sample product 1 for the ecommerce store.</p>",
  "Weighting": 0,
  "DisableForSiteSearch": false,
  "SKUCode": "DEMO1",
  "SmallImage": "/images/template-detail-dinewine-mobile@2x.png",
  "LargeImage": "/images/template-detail-dinewine-desktop@2x.jpg",
  "OnSale": false,
  "IsGiftVoucher": false,
  "ProductWeight": 0.0,
  "ProductWidth": 0.0,
  "ProductHeight": 0.0,
  "ProductDepth": 0.0,
  "EnableDropShipping": false,
  "UnitType": "",
  "MinimumUnits": 0,
  "MaximumUnits": 0,
  "RecurringType": "None",
  "IsShippable": true,
  "IsDownloadable": false,
  "NumberOfPossibleDownloads": 0,
  "Supplier": 0,
  "Price": 39.9500,
  "PriceHtml": "<span data-cms_product_data_price=\"2535\">39.95</span>",
  "priceWithTax": 41.55,
  "priceWithTaxHtml": "<span data-cms_product_data_price_with_tax=\"2535\">41.55</span>",
  "RecommendedPriceWithTax": 51.95,
  "RecommendedPriceWithTaxHtml": "<span data-cms_product_data_recommended_price_with_tax=\"2535\">51.95</span>",
  "RecommendedPrice": 49.9500,
  "RecommendedPriceHtml": "<span data-cms_product_data_recommended_price=\"2535\">49.95</span>",
  "EnableInventoryControl": true,
  "HasGeneratedInventoryProducts": true,
  "InStockHtml": "<span data-cms_product_data_in_stock=\"2535\">170</span>",
  "IsHide": false,
  "InStock": 170,
  "IsDisable": false,
  "taxRate": 0.0400,
  "IsGroupedProduct": true,
  "decimalsQuantity": 2,
  "VolumeDiscount": [
      "Price": 39.9500,
      "Quantity": 0
  "ProductDataJSON": {
    "itemId": 2535,
    "maximumUnits": 0,
    "minimumUnits": 0,
    "recommendedPrice": 49.9500,
    "QuantityThreshold": [
        "Price": 39.9500,
        "Quantity": 0
    "inStockTotal": 170,
    "prices": {
      "0": 39.9500
    "enablePreOrder": false,
    "variations": {
      "4608": {
        "id": "4608",
        "enabled": true,
        "inStock": 70,
        "optionIds": [
      "4606": {
        "id": "4606",
        "enabled": true,
        "inStock": 0,
        "optionIds": [
      "4604": {
        "id": "4604",
        "enabled": true,
        "inStock": 100,
        "optionIds": [
    "attributes": {
      "3661": {
        "id": "3661",
        "isInventory": true,
        "name": "Size",
        "type": 2,
        "required": true,
        "optionIds": [
    "options": {
      "3652": {
        "id": "3652",
        "attributeId": "3661",
        "name": "Small",
        "image": "/images/template-detail-crafter-mobile.png",
        "price": 0.0
      "3653": {
        "id": "3653",
        "attributeId": "3661",
        "name": "Medium",
        "image": "/images/template-crafter@2x.jpg",
        "price": 2.0000
      "3654": {
        "id": "3654",
        "attributeId": "3661",
        "name": "Large",
        "image": "/images/template-detail-crafter-desktop@2x.jpg",
        "price": 4.0000
    "taxRate": 0.0400,
    "taxInPercent": 4.0000
  "ProductDataJsonHTML": "<script>initEcommerceProductPriceVariations(2535,{\"itemId\":2535,\"maximumUnits\":0,\"minimumUnits\":0,\"recommendedPrice\":49.9500,\"QuantityThreshold\":[{\"Price\":39.9500,\"Quantity\":0}],\"inStockTotal\":170,\"prices\":{\"0\":39.9500},\"enablePreOrder\":false,\"variations\":{\"4608\":{\"id\":\"4608\",\"enabled\":true,\"inStock\":70,\"optionIds\":[\"3654\"]},\"4606\":{\"id\":\"4606\",\"enabled\":true,\"inStock\":0,\"optionIds\":[\"3653\"]},\"4604\":{\"id\":\"4604\",\"enabled\":true,\"inStock\":100,\"optionIds\":[\"3652\"]}},\"attributes\":{\"3661\":{\"id\":\"3661\",\"isInventory\":true,\"name\":\"Size\",\"type\":2,\"required\":true,\"optionIds\":[\"3652\",\"3653\",\"3654\"]}},\"options\":{\"3652\":{\"id\":\"3652\",\"attributeId\":\"3661\",\"name\":\"Small\",\"image\":\"/images/template-detail-crafter-mobile.png\",\"price\":0.0000},\"3653\":{\"id\":\"3653\",\"attributeId\":\"3661\",\"name\":\"Medium\",\"image\":\"/images/template-crafter@2x.jpg\",\"price\":2.0000},\"3654\":{\"id\":\"3654\",\"attributeId\":\"3661\",\"name\":\"Large\",\"image\":\"/images/template-detail-crafter-desktop@2x.jpg\",\"price\":4.0000}},\"taxRate\":0.0400,\"taxInPercent\":4.0000});</script>",
  "CreatedByMemberId": "0",
  "ItemCategories": [],
  "ItemCategoryIdList": [],
  "ItemTags": [],
  "Author": 0,
  "Author_Name": "",
  "Author_Url": "",
  "Item_Rating": 0,
  "MyCustomProperty": "My custom value",
  "ShowPageForSearchEngine": false,
  "MetaTitle": "",
  "SEOTitle": "",
  "MetaDescription": "",
  "CanonicalLink": "",
  "SocialMetaTags": "",
  "SeoPriority": 0.5,
  "EnableAMP": false,
  "AMPContent": "",
  "OpenGraphProperties": {
    "title": null,
    "type": null,
    "url": null,
    "locale": null,
    "image": null
  "ExternalId": 0,
  "Params": {
    "type": "ecommerce_item_quantity",
    "layout": "",
    "itemid": "2535",
    "collectionvariable": "qtyCollection"

Virtual Layout

If not using any custom layout or collection, the default virtual layout will output as follows:

<input type="number" data-ecommerce_product_quantity_field="{{}}" {% if this.minimumUnits > 0 %}min="{{this.minimumUnits}}"{% endif %} {% if this.maximumUnits > 0 %}max="{{this.maximumUnits}}"{% endif %} value="{% if this.minimumUnits > 0  and this.params.quantity == null %}{{this.minimumUnits}}{% else %}{{this.params.quantity | default: 1}}{% endif %}"/>

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:


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 "qtyCollection":

{% component type: "ecommerce_item_quantity", itemId: "2535", collectionVariable: "qtyCollection" %}

Accessing the name of the item, which in our example would render the value DEMO Product 1


Related Articles

  • Site Settings & Management

    The Treepl CMS Domain settings allow you to control default domain, landing pages, domain authentication for system emails along with country and cultural settings like number and currency formatting.
  • Site Settings & Management
    Payment Settings

    Integrate various payment gateways, for multiple countries and currencies, into Treepl CMS for form payments, subscriptions and eCommerce workflows.
  • CRM

    Orders store accounts of any payments made via the website and provide management for additional payments, invoices, order statuses, tracking info, the products purchased within the order and the details of the form submission used to take the order.
  • 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
    {{ order }} object

    This liquid object will output the order details of a submitted payment. ...
  • Liquid Components
    module (Catalogs)

    This module component fetches data relating to eCommerce Catalogs and can be used to render Catalog structures and Products within them.
  • Liquid Components
    module (Products)

    This module component fetches data relating to eCommerce Products and can be used to render Product information.
  • Liquid Components

    This component renders an anchor element allowing the javascript function to add the item to the shopping cart.
  • Liquid Components

    This component renders an anchor element allowing the javascript function to add the item to the shopping cart and then proceeding directly to the shopping cart page.
  • Liquid Components

    This component fetches all attributes/options for a specified product. By default, each attribute group is rendered, with its options and any prices, according to their specified form inputs.
  • Liquid Components

    This component fetches related items of a specific source item, such as a Product that has had Related Products assign to it.
  • Liquid Components

    This component fetches grouped items of a specific source item, such as a Product that has been Grouped with other Products and allows the ability to navigate between grouped items.
  • Liquid Components

    This component renders a form select element of all currency names, codes and symbols by default, and can also be used to output currency data to a Liquid collection.
  • Liquid Components

    This component fetches data relating to the shopping cart, such as any products added, order totals, tax, shipping, etc.
  • Liquid Components

    This component renders a form select element of all shipping options configured on the site, and can also be used to output shipping option data to a Liquid collection.
  • Liquid Components

    This component provides a placeholder for populating additional Shipping Provider options to the user.
  • Liquid Components

    This component renders a form select element of all tax codes configured on the site, and can also be used to output tax code data to a Liquid collection.
  • Liquid Components

    This component is used to render payment fields, and payment related validation errors, within a form using the capabilities provided by your configured payment gateway.
  • Liquid Components

    This component fetches Orders from the CRM, either owned by the logged-in user or for all customer Orders.
  • eCommerce
    Getting Started

    To get started with the eCommerce module there are some overall settings to configure that provide eCommerce with further context in order to function appropriately for your situation.
  • eCommerce

    Products are one of the most powerful and flexible modules in Treepl CMS. Create customised product schemas with multiple price points, catalogs, inventory tracked attributes/variables, SEO optimisation and more.
  • eCommerce

    When organising any eCommerce store, Catalogs are crucial to your Products structure and browserbility. Easily create and customise unlimited product catalogs for your online store.
  • eCommerce
    Discount codes

    Provide discount code functionality for your Treepl CMS shopping cart. Ideal for promotions, customer loyalty and conversions or to help move more stock.
  • eCommerce
    Gift vouchers

    Gift vouchers can be issued to your customers or purchased by them online via the shopping cart.
  • eCommerce

    Create any number of required tax codes specific to the shipping country selected in your Treepl CMS shopping cart.
  • Liquid Components

    This component renders a form select element of all country names and country codes by default, and can also be used to output country codes/names to a Liquid collection.
  • Liquid Components

    This module component retrieves settings associated with the current domain, or optionally from another specified domain configured in the site instance.
  • eCommerce
    Shipping Options

    Treepl CMS provides the ability to configure both custom shipping options and integrated shipping providers based on a variety of conditions during the shopping cart stage.
  • eCommerce

    These various eCommerce settings allow you to further control and customise the way your website functions, both in the admin and on the front-end, in terms of eCommerce functionality.
  • eCommerce
    eCommerce Javascript

    This is the provided javascript options for further controlling/customising the ecommerce javascript provided by the CMS.
  • Extensions
    Abandoned Cart Recovery

    With Abandoned Cart Recovery functionality, you can automatically send email reminders to customers who add products to their cart (while logged in) and leave without completing the order.
  • Public API
    CRM Orders

    Return or update Order item/s via the public API endpoint.
  • Extras
    Migrating to Advanced Payment Flow

    This article describes differences and possible required actions for migrating to the Advanced Payment Gateway flow.

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.


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 and we will consult you as soon as possible.