Theme Objects

Theme Objects

Liquid objects contain attributes to output dynamic content on the page. For example, the product object contains an attribute called name that can be used to output the name of a product.

Liquid objects are also often referred to as Liquid variables.

To output an object's attribute on the page, wrap them in {{ and }}, as shown below:

{{ product.name }} <!-- Output: “T-rex T-shirt” -->
ArrayArray object is a wrapper object containing other objects eg collection.products.
firstGet the first element of an array or blank if array contains no elements.
lastGet the last element of an array or blank if array contains no elements.
sizeGet a number of elements in an array.
indexAllows to access certain element of an array eg collection.products[3] or collection.products.3
ProductThe product object returns attributes relating to a product that exists in retailers store.
product.nameGet the name of the product.
product.handleGet the slug of the product.
product.descriptionGet the description of this product.
product.variantsGet the set of variants for the product.
product.master_variantGet the master variant for a product.
product.has_variantsWhether the product has variants (i.e. is a variant product (true) vs a simple product (false)).
product.first_available_variantReturns the first product variant that is available for purchase or alternatively null if no variants exists for purchase.
In order for a variant to be available for purchase its variant.inventory_quantity must be greater than zero or variant.track_inventory must be set to false.
product.main_imageGet the main image for the product.
product.urlGet the URL linking to the product. You need this for hyperlinking to this product's detail page from anywhere else in the store.
product.imagesGet URL for all the images associated with a product and its variants e.g. {% for image in product.images %} {{ image.src }} {% endfor %}
product.priceGet the price currently being sold at. By default this is the minimum price.
product.price_minGet the minimum price being sold at for the least expesive variant of this product.
product.price_maxGet the maximum price being sold at for the most expesive variant of this product.
product.price_variesGet whether the price varies. Returns True if the product's variants have varying prices. Returns false if all variants have the same price.
product.base_priceGet the base price i.e. the general pricebook price of the product. Note: If the product has variants and they have different price then product.base_price will return 0.
product.base_price_minGet the minimum base price.
product.base_price_maxGet the maximum base price.
product.base_price_variesGet whether the base price varies.
product.availableReturns false if all variants' quantities are zero.
product.brand.nameReturns the brand for the product.
product.product_type.nameReturns the product type e.g. General.
product.contentGet the description of this product (used on search page when iterating search results).
product.typeAlways returns product string (used on search page when iterating search results).
product.tagsReturns the tag object which returns an array of all product tags.
Note: Tags are returned in the order they were entered in Lightspeed Retail (X-Series).

Input:
{% for tag in product.tags %}
{{ tag.name }}
{% endfor %}

Output:
summer
new
special
dress
product.optionsReturns all options and option values applicable to this product.

Input:
{% for name, values in product.options %}
{{ name }}: [{{ values | join:", " }}]
{% endfor %}

Output:
Color: White, Black
Size: Small, Medium, Large
Variant
variant.availableReturns false if selected variant is sold out. Note: If variant.track_inventory is set to false then variant.available will return true
variant.idGet the ID of the variant.
variant.nameReturns the concatenation of all the variant's option values joined by / e.g. Small/Yellow.
variant.priceGet the price variant is currently being sold at.
variant.base_priceGet the base price i.e. recommended retail price for variant.
variant.track_inventoryWhether we track inventory for this variant at Lightspeed Retail (X-Series). Returns true if Lightspeed Retail (X-Series) Track Inventory is enabled.
variant.inventory_quantityReturns current inventory level for this variant (can also return negative value). If variant.track_inventory is set to false then returns 0.
variant.optionsReturns all options and option values applicable to this product.

Input:
{% for name, values in product.options %}
Tag
tag.nameReturns the name of the product tag.
Collections
collection.productsGet the set of products associated with this collection.
collection.nameGet the name of the collection.
collection.handleGet the unique slug of the collection.
collection.descriptionGet the description of the collection.
collection.products_countGet the number of products in the collection.
collection.sort_byGet what the products in the collection should be sorted by.
collection.urlGet the URL linking to the collection. You need this for hyperlinking to this collection from anywhere else in the store.
PageThe page object returns information about static pages that user has setup.
page.nameGet the title of the page.
page.handleGet the slug of the page (alias to getSlug).
page.contentGet the content of the page.
page.typeReturns page (used on search page when iterating search results).
page.urlGet the URL linking to the page. You need this for hyperlinking to this page from anywhere else in the store.
Search
search.termsReturns the search query which was entered in the search box.
search.performedReturns true if search was performed and false if search page was loaded with no search query (no search was performed).
search.resultsGet array of search results returned. The items in the array can be products and pages.
search.results_countGet number of search results returned.
search.urlGet the URL linking to the search. You need this for hyperlinking to this search from anywhere else in the store.
search.sort_byGet what the search results should be sorted by.
Paginate
paginate.current_pageGet the current page.
paginate.current_offsetHow many items did we skip over so far e.g. if you are paginating by 2 and are on the 3rd page then this would return 4.
paginate.itemsGet the total amount of items in this collection.
paginate.nextExists if there is a next page.
paginate.next.urlURL of the next page.
paginate.next.titleReturns the title of the link e.g. next.
paginate.next.islinkReturns true if the part is a link returns false if it is not.
paginate.previousExists if there is a previous page.
paginate.previous.urlURL of the previous page.
paginate.previous.titleReturns the title of the link e.g. previous.
paginate.previous.islinkReturns true if the part is a link returns false if it is not.
paginate.page_sizeGet the size of each page i.e. the amount of items displayed in each page.
paginate.pagesGet the amount of pages there are e.g. if showing 20 products per page and 100 products all together then returns 5.
Cart
cart.item_countGet the number of items currently in the shopping cart.
cart.itemsGet all the line items in the cart.
cart.total_priceGet the total price of the cart excluding tax and shipping as they are shown/recalculated at Order Summary.
cart.errorsReturns an error object when there was a problem.
cart.noteLets you capture more information on the cart page.
You can do this by submitting the cart form with an HTML textarea like:
<textarea name="note">{{ cart.note }}</textarea>
Cart ErrorThe error object returns information relating to any errors that occur in the cart object.
error.idGet ID related to error.
error.titleGet title for the error.
error.descriptionGet description for the error.
ItemThe item object represents a single line in the cart object. There is one line item for each distinct product variant in the cart. The item object can be accessed via the cart.items object.
item.idGet the id of the line item.
item.line_priceGet the combined price of all the items in the line item. This is the equivalent of item.price times item.quantity.
item.quantityGet the quantity for a line item.
item.priceGet the price for the line items variant i.e. returns the unit price.
item.productGet all of the data associated with the product object e.g. item.product.description will return the description of the product associated with the line item variant.
item.variantGet all of the data associated with the variant object e.g. item.variant.base_price will return the base price i.e. recommended retail price of the line item.
item.imageGet the image associated with the line item i.e. the product.main_image.
NavigationThe navigation object represent the navigation that user sets up e.g. Main Menu or Footer.
navigation.idGet the id for the navigation.
navigation.handleGet the handle for the navigation.
navigation.nameGet the name of the navigation.
navigation.linksGet an array of links in the navigation.
LinkThe link object represents the information relating to the online store.
activeReturns true if the link is active.
titleGet the title of the link.
typeGet the type of link e.g front page page collection http.
urlGet the url of the link.
StoreThe store object represents the general information relating to the online store.
nameReturns the name of the online store as defined in General Settings page.
meta_titleReturns the home page title for the online store as defined in General Settings page.
meta_descriptionReturns the meta description for the online store as defined in General Settings page.
meta_keywordsReturns the meta keywords for the online store as defined in General Settings page.
FormThe form object is used within the form tag.
form.posted_successfullyReturns true if form was submitted and successfully passed through validation.
form.errorsReturns form errors if form was submitted and contains errors.
form.fieldReturns value of a form field if form was submitted eg form.email will return value of email address field entered by user.
Form ErrorThe error object returns information relating to any errors that occur while form processing.
error.fieldName of a field which did not pass validation. If the error is general and related to the whole form blank is returned.
error.messageError message.