website logo
⌘K
Introduction
PORTAL
Agency Whitelabelling
PAGES
Pages - Accessing Page Data
Pagination Layouts
Page Templates
FORMS
Form Confirmation Pages
Adding a Progress Bar
Adding Custom CSS To Show Form Submit Process
Dynamic Content in Workflow and Autoresponder Emails
How to output Custom Field Set fields in a Form's Custom Layout
Custom JavaScript Validation for Forms
File Upload Previews
FAQ
CATEGORIES
Filtering WebApps and Modules by Categories
Outputting Categories on WebApp / Module / eCommerce Layouts
Outputting Category Fields in any Location
Category Detail Layouts
FAQ
COMPANY INFORMATION
Company Information
SITE SEARCH
Site Search
PUBLIC API/ZAPIER
Zapier - Formatting arrays correctly
Public API/Zapier Changelog
MODULES
Module Marketplace
Building Custom Modules
Siteglide Modules
Front-end Submit Modules
DATA STRUCTURES
Automations
Creating WebApps from the CLI
Field Types
WEBAPPS
Front-end Submit WebApps
Layouts
Search and Filtering
Understanding Custom Field Names and IDs
FAQ
CRM
User Details
User Secure Zones
Storing User's Favourite WebApp / Module Items
User's Form Submissions (Cases)
How Users Edit their Email and Password Front End
Editing a User's CRM record Front End with Custom Field Sets
CLI
Introducing Siteglide CLI
CLI Changelog
Secure Zones with CLI
Page Templates with Siteglide CLI
Pages with Siteglide CLI
Includes with Siteglide CLI
Managing Email Templates
Migrate - Manual Form setup
Migrate - Convert existing Forms
Liquid
Accessing Assets
Liquid Dot Notation
Using WebApp Collections- Tutorial
Using the current_user object with Secure Zones
Preventing Duplicate Content with Query Parameters- Canonical URL and Robots.txt
FAQ
GraphQL
Tutorial Overview
About GraphQL
Tutorial 1- Your First Query
Tutorial 2 - Pagination
Tutorial 3 - Filtering the Results
Tutorial 3 - Answers to the First Filtering Challenge
Tutorial 4 - Advanced Filtering
Tutorial 4 - Challenge Answers
Tutorial 5 - Using Liquid to run GraphQL queries on your Site
Tutorial 6 - Variables
Tutorial 6 - Answers to the Variables Challenge
Tutorial 7 - Sorting
Tutorial 8 - Building a Liquid API GET Endpoint Page powered by GraphQL queries
Best Practice and Performance
Module/WebApp Caching
Getting Started with Liquid Caching - to Reduce Server Response time and Improve Performance
Includes
ecommerce/checkout_standard
Frequently Asked Questions
Using Liquid Logic to Check if a field exists, or is empty on the Front End
How do I learn more about Liquid?
How to setup a multi domain start page
Docs powered by archbee 
10min

Liquid Reference for Product and Attribute Layouts

While building Product and Attribute Layouts, a large range of dynamic data is available- here is a full reference guide.

"This" Object Fields

The "this" object can be accessed on Product detail/item.liquid, list/item.liquid and attribute layout files. It contains the properties of the current Product and contains further relevant objects e.g. Price.

The entire "this" object can be outputted on the page for reference: {{this | json}} The following fields are available:

Field Name

Liquid Tag

Description

Item Name

{{this.name}}

The Product's name

Item Slug

{{this.slug}}

The part of the URL for this Product's Detail Page which refers directly to this Product

Creation Date

{{this.create_date}}

The date the Product was created in Admin

Last Edit Date

{{this.last_edit_date}}

The date this Product was last edited in Admin

Release Date

{{this.release_date}} 

The date this Product is scheduled for release, or was first released on the Site. (A Product will not appear in the list if it has not been released.)

Expiry Date

{{this.expiry_date}} 

The date this Product will be no longer visible on the Site. (A Product will not appear in the list if it has expired.)

Enabled

{{this.enabled}} 

A "true" or "false" boolean value. If "false", the Product will not appear in the list.

Category Array

{{this.category_array}}

An array of ids of categories associated with this Product.

Description

{{this.Description}}

A description of the Product.

Image

{{this.Image}}

This is the main image for the Product, but more can be added with Custom Field Sets.

Accessing Custom Field Sets

Custom Field Set data linked to Products is available in Product detail/item.liquid, list/item.liquid and attribute layout files.

Any Custom Field Sets that have been associated with the product will be stored under: {{this.cfs_data}}

You can output the above liquid in the item.liquid file to see all of Custom Field Sets associated with the Product. Each of these will have the key "cfs_1", "cfs_2" etc. For example, a developer has created just one Custom Field Set to store information about the Guarantee on the Product. The field can be accessed via: {{this.cfs_data.cfs_1.Guarantee}} See more information about Custom Field Sets here.

The Price Object

The Price object contains all the information you need to display the Product's price in the format you want. It is available in Product detail/item.liquid, list/item.liquid and attribute layout files.

Field Name

Liquid Tag

Description

Price ID

{{this.price.id}}

The unique ID of this Product's price.

Product ID

 {{this.price.product_id}}

The unique ID of the Product this Price belongs to.

Currency

{{this.price.currency}}

The currency code for the currency used by this Product e.g. "GBP".

Price Charge

{{this.price.price_charge}}

The price of the Product as an integer e.g. for the price "£200.00" this field will display "20000"

Display Price

{{this.price.price_display}}

If the optional field Display Price was filled out when the Product was created, this will show that price as an integer, else, it will output null. This could be for example the RRP or price before tax.

Currency Symbol

{{this.price.currency_symbol}}

The HTML entity for the currency symbol. e.g. "£" outputted on the page will display "£" when HTML is rendered.

Price Display Formatted

{{this.price.price_display_formatted}}

If the optional field Display Price was filled out when the Product was created, this will show that price as an decimal number, else, it will output null. This could be for example the RRP or price before tax.

Price Charge Formatted

{{this.price.original_price_charge_formatted}}

This is the price that will be charged to the user, formatted into dollars and cents.

Price Charge Before Tax Formatted

{{this.price.price_charge_before_tax_formatted}}

This is the price before any tax is applied, formatted into dollars and cents.

The Inventory Object

The Inventory object contains the fields related to the current Inventory of this Product. It is available in Product detail/item.liquid, list/item.liquid and attribute layout files.

Field Name

Liquid Tag

Description

Inventory ID

{{this.inventory.id}}

The unique ID of the object containing the Product's Inventory.

Enabled

{{this.inventory.enabled}}

A "true" or "false" boolean, defaults to true.

Product ID

{{this.inventory.product_id}}

The unique ID of the Product this Inventory Object belongs to.

Quantity

{{this.inventory.quantity}}

The number of products in the inventory.

Inventory Type

{{this.inventory.inventory_type}}

The type of Inventory. Currently, only "Global" is available.

Display Type

{{this.inventory.display_type}}

This stores the policy on what to do when the Inventory reaches zero. Either the Product can not be ordered, or it should be hidden from view.

The Attributes Object

These are available once Attributes have been added against the Product in Admin and you are inside a detail/item.liquid file or an Attribute layout file.

You can access the Attributes Object via the following liquid output: {{ this.product_attribute_options }}

Inside the Attribute Layout

Output Options for this Layout

Inside the Attribute Layout, you can access just the Options for that specific Attribute: {{ product_attribute_options }}

Output this Attribute's Name

You can also access the name of the Attribute this Layout is currently displaying: {{this_attribute.properties.name}}

Looping Over Attribute Options and Accessing Option Fields

As explained in the Attributes Layout Doc, we recommend you loop over the object and access the fields via the "option" liquid variable.

HTML
|

Assuming the above example liquid forloop has been implemented, you can access the fields in the table below. Remember the "option" liquid variable can be renamed, so if you have done this, replace "option" with the name you have given the variable. The Object contains Attribute Options and each of these contains information on the Attribute it is linked with.

Field Name

Liquid Tag

Description

Attribute Option ID

{{ option.id }}

The unique ID of this Attribute Option

Attribute Option Name

{{ option.name }}

The name of this Attribute Option

Attribute Option Chargable Price

{{ option.price_charge }}

Chargable price for this Attribute Option

Attribute Option Chargable Price Formatted

{{ option.price_charge_formatted }}

Formatted chargable price for this Attribute Option

Attribute Option Display Price

{{ option.price_display }}

Display price for this Attribute Option

Attribute Option Display Price Formatted

{{ option.price_display_formatted }}

Formatted display price for this Attribute Option

Attribute Option Image

{{ option.image}}

The image for this Attribute Option

Attribute ID

{{ option.product_attribute.id }}

The Unique ID of this Attribute

Attribute Name

{{ option.product_attribute.name }}

The Name of the Attribute e.g. Size or Colour

Attribute

{{ option.product_attribute.product_id }}

The Unique Product ID that this Attribute is associated with.

Updated 26 Apr 2022
Did this page help you?
Yes
No
UP NEXT
List Layouts
Docs powered by archbee 
TABLE OF CONTENTS
"This" Object Fields
Accessing Custom Field Sets
The Price Object
The Inventory Object
The Attributes Object
Inside the Attribute Layout
Output Options for this Layout
Output this Attribute's Name
Looping Over Attribute Options and Accessing Option Fields