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.
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
| Object | Present on | What it is |
|---|---|---|
| section | Every section | The section being rendered: its id, its settings and its blocks. |
| product | Product pages | The product the page is for. Empty on every other route, so guard it. |
| product.variants[] | Inside product | One per purchasable combination. A product with no choices has one default variant that mirrors it. |
| products | Sections that declare product_source | An array of product drops. See Products, collections & posts. |
| collection | Collection pages, or product_source = collection | The collection the page is for. |
| collections | Sections that declare collection_source | An array of collection drops. |
| article | Blog post pages | The blog post the page is for. |
| articles | The blog index, or article_source | An array of article drops. |
| linklists | Every route | Navigation menus keyed by handle: linklists["main-menu"].links. See Navigation menus. |
| shop | Every route | The store itself. |
| page | Every route | The page being rendered. |
| settings | Every route | The merchant’s theme tokens as data. See Theme tokens. |
| request | Every route | Shopify’s request global. |
| template | Every route | Prints as the page type (product, or product.wholesale). Exposes name, suffix and directory. |
| routes | Every route | The storefront’s own URLs, under Shopify’s names. |
| cart | Cart drawer overlay only | The shopper’s cart. It lives in the browser, so it never reaches a server-rendered page section. |
| search | /search | The shopper’s search and its results. |
| order | /track-order and account order pages | One order, as its customer sees it. |
| customer | Account pages | The signed-in shopper. |
| shipping_rates | When the merchant shows shipping rates | The store’s delivery zones and rates. |
section
The section being rendered: its id, its settings and its blocks. Present on: Every section.
| Field | Type | Notes |
|---|---|---|
| id | string | Unique on the page. Put it in class names and element ids so two copies of a section never collide. |
| settings | object | The values of your schema settings, keyed by id. Missing values are filled from the schema defaults and @color.* references are resolved. |
| blocks | block[] | 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.
| Field | Type | Notes |
|---|---|---|
| id | string | What data-joomni-product-id wants. |
| title | string | Escape it inside attributes. |
| description | HTML | The merchant’s rich description. Output it as-is. |
| handle | string | The URL slug. |
| url | string | /products/<handle> |
| price | number | Format it with | money. |
| compare_at_price | number | null | The “was” price. |
| on_sale | boolean | True when compare_at_price is above price. |
| featured_image | string | null | First image URL. Use | image_url: 800 to resize. |
| images | string[] | Every image URL, in order. |
| tags | string[] | Test with contains. |
| vendor | string | null | Brand. |
| type | string | null | Product type. |
| sku | string | null | — |
| available | boolean | True when stock is not tracked, units are on hand, or backorders are allowed. |
| inventory | number | null | Sum across variants. null (renders blank) when not tracked. |
| tracks_inventory | boolean | Test this before showing a count. |
| variants | variant[] | Always at least one. |
| options | option[] | The axes: { name: "Size", values: ["S", "M"] }. |
| custom_fields | field[] | key, label, value: anything the merchant added. |
| collections | ref[] | id, title, handle, url of each collection it is in. |
| reviews | reviews | null | Present only when the Product Reviews extension is on: rating, count, distribution[], items[], has_more, form. |
| metadata | object | Free-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.
| Field | Type | Notes |
|---|---|---|
| id | string | What data-joomni-variant-id wants. |
| title | string | “M / Blush” |
| price · compare_at_price · on_sale | number · number|null · boolean | Variant pricing. |
| sku | string | null | — |
| available · inventory | boolean · number|null | Stock is read from the variant. |
| image | string | null | Falls back to nothing. Use | default: product.featured_image. |
| options | object | This variant’s value per option: { Size: "M" }. |
collection
The collection the page is for. Present on: Collection pages, or product_source = collection.
| Field | Type | Notes |
|---|---|---|
| id · title · handle · url | string | — |
| description | string | null | — |
| image | string | null | — |
| products | product[] | The products on this page of the collection. |
| products_count | number | Total in the collection. |
article
The blog post the page is for. Present on: Blog post pages.
| Field | Type | Notes |
|---|---|---|
| id · title · handle · url | string | — |
| excerpt | string | Plain text summary. |
| content | HTML | The full post. |
| image | string | null | Cover image. |
| tags | string[] | — |
| author.name | string | author is null when unknown. |
| published_at · created_at | ISO date | null | Format with | date: "%b %d, %Y". |
| reading_time | number | Minutes. |
| view_count | number | — |
linklists
Navigation menus keyed by handle: linklists["main-menu"].links. See Navigation menus. Present on: Every route.
| Field | Type | Notes |
|---|---|---|
| <handle>.title · handle | string | — |
| <handle>.links | link[] | title, url, type, active, child_active, levels, links (children), icon, badge, image, description. |
| <handle>.levels | number | Depth of the deepest branch. |
shop
The store itself. Present on: Every route.
| Field | Type | Notes |
|---|---|---|
| name | string | — |
| domain | string | null | — |
| currency | string | “NPR”. | money already uses it. |
| logo | string | null | — |
| primary_color | string | null | — |
| customer_accounts | string | guest_only, optional or required. Hide the account icon when guest_only. |
page
The page being rendered. Present on: Every route.
| Field | Type | Notes |
|---|---|---|
| title · handle · url | string | — |
settings
The merchant’s theme tokens as data. See Theme tokens. Present on: Every route.
| Field | Type | Notes |
|---|---|---|
| color_* | hex | primary, on_primary, secondary, on_secondary, accent, on_accent, background, surface, text, text_muted, border, success, warning, danger and their on_*. |
| font_heading · font_body | string | Font family names. |
| font_size_base · font_weight_heading · font_weight_body · line_height_base · letter_spacing_heading | number | — |
| radius · border_width · shadow | number · number · string | — |
| layout_max_width · section_spacing · gutter | number | Pixels. |
| button_radius · button_style · button_uppercase · button_weight | mixed | button_style is solid or outline. |
request
Shopify’s request global. Present on: Every route.
| Field | Type | Notes |
|---|---|---|
| design_mode | boolean | True in the theme editor, false on the live store. Use it to keep animations still or show editor-only hints. |
| page_type | string | index, product, collection, list-collections, page, blog, article, search, cart, customers/account, customers/login, customers/register, customers/order, 404, checkout. |
| path · host · origin | string | “/products/blue-mug” |
| locale.iso_code | string | “en” |
template
Prints as the page type (product, or product.wholesale). Exposes name, suffix and directory. Present on: Every route.
| Field | Type | Notes |
|---|---|---|
| name | string | Same as request.page_type. |
| suffix | string | null | The alternate template name, if any. |
| directory | string | null | “customers” for account pages. |
routes
The storefront’s own URLs, under Shopify’s names. Present on: Every route.
| Field | Type | Notes |
|---|---|---|
| root_url | string | / |
| account_url | string | /account |
| account_login_url | string | /account/login |
| account_logout_url | string | /account/logout |
| account_register_url | string | /account/register |
| account_recover_url | string | /account/forgot-password |
| account_addresses_url | string | /account |
| collections_url | string | /collections |
| all_products_collection_url | string | /products |
| products_url | string | /products |
| search_url | string | /search |
| predictive_search_url | string | /search |
| cart_url | string | /cart |
| cart_add_url | string | /cart |
| cart_change_url | string | /cart |
| cart_clear_url | string | /cart |
| cart_update_url | string | /cart |
| blogs_url | string | /blog |
| track_order_url | string | /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.
| Field | Type | Notes |
|---|---|---|
| items | line[] | key, product_id, variant_id, title, variant_title, handle, url, image, price, quantity, line_price. |
| item_count | number | — |
| total_price | number | Before discount. |
| discount_amount · discount_title | number · string|null | — |
| final_price | number | After discount, before shipping. |
| is_empty | boolean | — |
| cart_url · checkout_url | string | — |
search
The shopper’s search and its results. Present on: /search.
| Field | Type | Notes |
|---|---|---|
| terms | string | What was typed. Empty on a bare /search. |
| performed | boolean | True once there are terms, even if nothing matched. |
| results · results_count | product[] · number | — |
| types | string[] | Distinct product types among the results. |
| price_min · price_max | number | 0 with no results. |
| url | string | Where the form posts. Always /search. |
order
One order, as its customer sees it. Present on: /track-order and account order pages.
| Field | Type | Notes |
|---|---|---|
| number · name · created_at | string | — |
| status · status_label · status_tone | string | status_tone is info, warning, success or danger. |
| financial_status · paid · fulfillment_status | mixed | — |
| cancelled · delivered · open | boolean | — |
| step · steps[] · progress | number · step[] · number | steps: placed, processing, dispatched, delivered, each with label, done, current. |
| items | line[] | title, variant_title, sku, quantity, price, line_price, image. |
| subtotal · shipping · tax · discount · total | number | — |
| shipping_address | address | null | name, city, province, country, zip, phone, locality. |
| shipments · has_shipments | shipment[] · boolean | carrier, tracking_number, tracking_url, status_label, events[]. |
| payment_method_label · note · customer_name · url | string | — |
customer
The signed-in shopper. Present on: Account pages.
| Field | Type | Notes |
|---|---|---|
| name · first_name · email | string | — |
| orders · orders_count · open_orders_count | order[] · number | — |
| total_spent | number | — |
| has_orders | boolean | — |
| account_url · orders_url | string | — |
shipping_rates
The store’s delivery zones and rates. Present on: When the merchant shows shipping rates.
| Field | Type | Notes |
|---|---|---|
| enabled | boolean | False when the merchant has not turned the table on. |
| zones · zones_count | zone[] · number | Each zone: name, coverage[], matched, rates[]. |
| zones[].rates[] | rate[] | name, price, free, description, order_min, order_max, days_min, days_max, delivery. |
| profiles | profile[] | For stores with more than one shipping profile. |
| placements | string[] | cart, product, page. Test placements contains "product". |
| price_min · note · url | mixed | — |
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.
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.