LiquidObjects

Objects

Objects (Shopify calls them drops) are the data a template reads: the product on a product page, the store's menus, the merchant's theme colours. They are filled in before the template runs, and a template cannot fetch anything else.

Explore the sample data

This is the data the playground and the Studio editor render against. Open an object to see its fields; click a value to copy its Liquid tag. Switch the route to see which objects disappear off their own page.

Object explorer

Click a value to copy its Liquid tag. Switch the route to see which objects are empty off their own page.

Guard page objects

product, collection and article exist only on their own pages. Anywhere else they are empty and print nothing, so a section that reads them without checking becomes a heading over an empty box. Wrap the use in {% if product %}, or give the section an empty state.

Where each object exists

ObjectPresent onWhat it is
sectionEvery sectionThe section being rendered: its id, its settings and its blocks.
productProduct pagesThe product the page is for. Empty on every other route, so guard it.
product.variants[]Inside productOne per purchasable combination. A product with no choices has one default variant that mirrors it.
productsSections that declare product_sourceAn array of product drops. See Products, collections & posts.
collectionCollection pages, or product_source = collectionThe collection the page is for.
collectionsSections that declare collection_sourceAn array of collection drops.
articleBlog post pagesThe blog post the page is for.
articlesThe blog index, or article_sourceAn array of article drops.
linklistsEvery routeNavigation menus keyed by handle: linklists["main-menu"].links. See Navigation menus.
shopEvery routeThe store itself.
pageEvery routeThe page being rendered.
settingsEvery routeThe merchant’s theme tokens as data. See Theme tokens.
requestEvery routeShopify’s request global.
templateEvery routePrints as the page type (product, or product.wholesale). Exposes name, suffix and directory.
routesEvery routeThe storefront’s own URLs, under Shopify’s names.
cartCart drawer overlay onlyThe shopper’s cart. It lives in the browser, so it never reaches a server-rendered page section.
search/searchThe shopper’s search and its results.
order/track-order and account order pagesOne order, as its customer sees it.
customerAccount pagesThe signed-in shopper.
shipping_ratesWhen the merchant shows shipping ratesThe store’s delivery zones and rates.

section

The section being rendered: its id, its settings and its blocks. Present on: Every section.

FieldTypeNotes
idstringUnique on the page. Put it in class names and element ids so two copies of a section never collide.
settingsobjectThe values of your schema settings, keyed by id. Missing values are filled from the schema defaults and @color.* references are resolved.
blocksblock[]Only when the schema declares blocks. Each block has id, type, index, settings and joomni_attributes.

product

The product the page is for. Empty on every other route, so guard it. Present on: Product pages.

FieldTypeNotes
idstringWhat data-joomni-product-id wants.
titlestringEscape it inside attributes.
descriptionHTMLThe merchant’s rich description. Output it as-is.
handlestringThe URL slug.
urlstring/products/<handle>
pricenumberFormat it with | money.
compare_at_pricenumber | nullThe “was” price.
on_salebooleanTrue when compare_at_price is above price.
featured_imagestring | nullFirst image URL. Use | image_url: 800 to resize.
imagesstring[]Every image URL, in order.
tagsstring[]Test with contains.
vendorstring | nullBrand.
typestring | nullProduct type.
skustring | null—
availablebooleanTrue when stock is not tracked, units are on hand, or backorders are allowed.
inventorynumber | nullSum across variants. null (renders blank) when not tracked.
tracks_inventorybooleanTest this before showing a count.
variantsvariant[]Always at least one.
optionsoption[]The axes: { name: "Size", values: ["S", "M"] }.
custom_fieldsfield[]key, label, value: anything the merchant added.
collectionsref[]id, title, handle, url of each collection it is in.
reviewsreviews | nullPresent only when the Product Reviews extension is on: rating, count, distribution[], items[], has_more, form.
metadataobjectFree-form extra data.

product.variants[]

One per purchasable combination. A product with no choices has one default variant that mirrors it. Present on: Inside product.

FieldTypeNotes
idstringWhat data-joomni-variant-id wants.
titlestring“M / Blush”
price · compare_at_price · on_salenumber · number|null · booleanVariant pricing.
skustring | null—
available · inventoryboolean · number|nullStock is read from the variant.
imagestring | nullFalls back to nothing. Use | default: product.featured_image.
optionsobjectThis variant’s value per option: { Size: "M" }.

collection

The collection the page is for. Present on: Collection pages, or product_source = collection.

FieldTypeNotes
id · title · handle · urlstring—
descriptionstring | null—
imagestring | null—
productsproduct[]The products on this page of the collection.
products_countnumberTotal in the collection.

article

The blog post the page is for. Present on: Blog post pages.

FieldTypeNotes
id · title · handle · urlstring—
excerptstringPlain text summary.
contentHTMLThe full post.
imagestring | nullCover image.
tagsstring[]—
author.namestringauthor is null when unknown.
published_at · created_atISO date | nullFormat with | date: "%b %d, %Y".
reading_timenumberMinutes.
view_countnumber—

linklists

Navigation menus keyed by handle: linklists["main-menu"].links. See Navigation menus. Present on: Every route.

FieldTypeNotes
<handle>.title · handlestring—
<handle>.linkslink[]title, url, type, active, child_active, levels, links (children), icon, badge, image, description.
<handle>.levelsnumberDepth of the deepest branch.

shop

The store itself. Present on: Every route.

FieldTypeNotes
namestring—
domainstring | null—
currencystring“NPR”. | money already uses it.
logostring | null—
primary_colorstring | null—
customer_accountsstringguest_only, optional or required. Hide the account icon when guest_only.

page

The page being rendered. Present on: Every route.

FieldTypeNotes
title · handle · urlstring—

settings

The merchant’s theme tokens as data. See Theme tokens. Present on: Every route.

FieldTypeNotes
color_*hexprimary, on_primary, secondary, on_secondary, accent, on_accent, background, surface, text, text_muted, border, success, warning, danger and their on_*.
font_heading · font_bodystringFont family names.
font_size_base · font_weight_heading · font_weight_body · line_height_base · letter_spacing_headingnumber—
radius · border_width · shadownumber · number · string—
layout_max_width · section_spacing · gutternumberPixels.
button_radius · button_style · button_uppercase · button_weightmixedbutton_style is solid or outline.

request

Shopify’s request global. Present on: Every route.

FieldTypeNotes
design_modebooleanTrue in the theme editor, false on the live store. Use it to keep animations still or show editor-only hints.
page_typestringindex, product, collection, list-collections, page, blog, article, search, cart, customers/account, customers/login, customers/register, customers/order, 404, checkout.
path · host · originstring“/products/blue-mug”
locale.iso_codestring“en”

template

Prints as the page type (product, or product.wholesale). Exposes name, suffix and directory. Present on: Every route.

FieldTypeNotes
namestringSame as request.page_type.
suffixstring | nullThe alternate template name, if any.
directorystring | null“customers” for account pages.

routes

The storefront’s own URLs, under Shopify’s names. Present on: Every route.

FieldTypeNotes
root_urlstring/
account_urlstring/account
account_login_urlstring/account/login
account_logout_urlstring/account/logout
account_register_urlstring/account/register
account_recover_urlstring/account/forgot-password
account_addresses_urlstring/account
collections_urlstring/collections
all_products_collection_urlstring/products
products_urlstring/products
search_urlstring/search
predictive_search_urlstring/search
cart_urlstring/cart
cart_add_urlstring/cart
cart_change_urlstring/cart
cart_clear_urlstring/cart
cart_update_urlstring/cart
blogs_urlstring/blog
track_order_urlstring/track-order

cart

The shopper’s cart. It lives in the browser, so it never reaches a server-rendered page section. Present on: Cart drawer overlay only.

FieldTypeNotes
itemsline[]key, product_id, variant_id, title, variant_title, handle, url, image, price, quantity, line_price.
item_countnumber—
total_pricenumberBefore discount.
discount_amount · discount_titlenumber · string|null—
final_pricenumberAfter discount, before shipping.
is_emptyboolean—
cart_url · checkout_urlstring—

The shopper’s search and its results. Present on: /search.

FieldTypeNotes
termsstringWhat was typed. Empty on a bare /search.
performedbooleanTrue once there are terms, even if nothing matched.
results · results_countproduct[] · number—
typesstring[]Distinct product types among the results.
price_min · price_maxnumber0 with no results.
urlstringWhere the form posts. Always /search.

order

One order, as its customer sees it. Present on: /track-order and account order pages.

FieldTypeNotes
number · name · created_atstring—
status · status_label · status_tonestringstatus_tone is info, warning, success or danger.
financial_status · paid · fulfillment_statusmixed—
cancelled · delivered · openboolean—
step · steps[] · progressnumber · step[] · numbersteps: placed, processing, dispatched, delivered, each with label, done, current.
itemsline[]title, variant_title, sku, quantity, price, line_price, image.
subtotal · shipping · tax · discount · totalnumber—
shipping_addressaddress | nullname, city, province, country, zip, phone, locality.
shipments · has_shipmentsshipment[] · booleancarrier, tracking_number, tracking_url, status_label, events[].
payment_method_label · note · customer_name · urlstring—

customer

The signed-in shopper. Present on: Account pages.

FieldTypeNotes
name · first_name · emailstring—
orders · orders_count · open_orders_countorder[] · number—
total_spentnumber—
has_ordersboolean—
account_url · orders_urlstring—

shipping_rates

The store’s delivery zones and rates. Present on: When the merchant shows shipping rates.

FieldTypeNotes
enabledbooleanFalse when the merchant has not turned the table on.
zones · zones_countzone[] · numberEach zone: name, coverage[], matched, rates[].
zones[].rates[]rate[]name, price, free, description, order_min, order_max, days_min, days_max, delivery.
profilesprofile[]For stores with more than one shipping profile.
placementsstring[]cart, product, page. Test placements contains "product".
price_min · note · urlmixed—

Stock is read from the variants

Every product has at least one variant. When it has real choices, the variants carry the stock and product.inventory is their sum; a product with no choices has one default variant that mirrors it. available is true when stock is not tracked, when units are on hand, or when the merchant allows backorders. inventory is null when the product does not track stock, so check tracks_inventory before showing a count.

Variant stockliquid
{%- if product -%}
{%- for v in product.variants -%}
<p>
{{ v.title }} · {{ v.price | money }} ·
{%- if v.available == false %} Sold out
{%- elsif product.tracks_inventory and v.inventory <= 5 %} Only {{ v.inventory }} left
{%- else %} In stock
{%- endif -%}
</p>
{%- endfor -%}
{%- else -%}
<p>Not a product page.</p>
{%- endif -%}

Objects inside lists

products, collections and articles are arrays of the same objects as product, collection and article, filled only when a section asks for them. See Products, collections & posts. Menus are on Navigation menus.

Still stuck? Our team reads every message.

Need help?