Skip to content

Objects

The data every page and section can read — shop, product, cart, order and more.

Templates read the store’s data through objects.

All amounts are in minor units (cents): print them with a money filter. A property that doesn’t exist prints nothing.

Object What it is
shop The store: name, description, email, phone, url, currency, locale, direction and is_rtl (storefronts are left-to-right for now), cities (empty means “delivers anywhere”), shipping (default shipping fee), has_online_payment, product_count, collections_count
routes Store URLs: root_url, all_products_url, all_collections_url, search_url, cart_url, thanks_url, tracking_url, pages_url, account_url, account_login_url, account_register_url, account_logout_url, the add-to-cart form without JavaScript: cart_add_url, and the cart API: cart_api_url, cart_items_url, cart_change_url, cart_clear_url
settings The theme settings
template The current template’s name: product, collection…
cart The visitor’s cart (always present, even when empty)
customer The signed-in customer, or an empty one: check customer.logged_in
linklists Menus by handle: linklists['main-menu']

Inside a section: section (id, type, settings, blocks). Inside a block: block (id, type, settings).

Template Also has
index products
product product, recommendations; after a rejected order, errors
collection collection, products
list-collections collections
page page
search search, products, terms, results_count
cart cart
thanks reference, order
tracking order, ref, phone, error
account-login, account-register errors
account orders (the customer’s own orders)
404 products

id, title, handle, url, description (HTML), excerpt, vendor, type, tags, sku

  • Price: price, compare_at_price, price_min, price_max, price_varies
  • Stock: available, stock
  • Images: featured_image, images
  • Options and variants: options (names, e.g. ["Colour", "Size"]), options_with_values, variants, has_variants, first_available_variant, selected_or_first_available_variant
  • Offers: offers (quantity bundles), has_offers, featured_offer, upsells (add-ons on the order form), automatic_discounts, has_automatic_discount
  • Reviews: reviews, reviews_count, rating, has_reviews, review_summary
  • Other: collections, structured_data (JSON-LD for a <script type="application/ld+json">), created_at, updated_at

id (what the order form sends as variant_id), title, price, compare_at_price, available, active, stock, image, options (["Black", "M"]), option1, option2, option3

A quantity bundle: quantity, label, price (the whole bundle), unit_price, compare_at, saving, saving_percentage, featured, variant_prices.

When a bundle costs differently per variant, put data-offer-prices={offer.variant_prices | json} on the bundle’s element, and data-offer-price / data-offer-unit on its price texts. The store’s own script swaps them when the shopper picks another variant.

An add-on on the order form: id (the checkbox value), title, name, description, price, compare_at, saving, image, available, preselected, placement, is_post_purchase.

review: author_name, author_city, author_with_location, title, content, rating, created_at, images, has_images, verified_buyer, reply, has_reply.

review_summary: average_rating, total_reviews, stars_breakdown ({stars, count, percentage} per star level), percentage_recommended, has_reviews.

id, title, handle, url, description, image, products, products_count, all_products_count, is_empty, filters, sort_by, default_sort_by, sort_options

search has the same filters and sorting, plus terms, performed, results, results_count and all_results_count.

Each filter: label, type (list or price_range), param_name, values, active_values, min_value, max_value, range_max, url_to_remove. Each value: label, value, count, active, url_to_add, url_to_remove.

Paginate a product list in a section’s frontmatter, then read the page:

---
const paginate = paginate(collection.products, { by: 24 });
---
<template>
<div class="grid">{paginate.items.map(item => <ProductCard product={item} />)}</div>
<If condition={paginate.pages > 1}>
<nav>
{paginate.previous_url && <a href={paginate.previous_url}>Previous</a>}
{paginate.next_url && <a href={paginate.next_url}>Next</a>}
</nav>
</If>
</template>

paginate also has current_page, total_pages, items_total, per_page, previous, next, and parts: a ready-made page list with gaps collapsed (“1 … 4 5 6 … 20”).

lines, count, is_empty, subtotal (before discounts), discount_amount, discount_title, discount_applications, discount_code, coupon_error, has_discount, total, currency, note, attributes

Each line: index, product_id, variant_id, title, variant_name, quantity, unit_price, line_total, available, image, url.

On the thank-you and tracking pages: reference, customer_name, phone, city, address, paid, items, subtotal_formatted, shipping_formatted, has_shipping, discount_formatted, discount_title, has_discount, total_formatted, status_label_key, and the one-click add-on after purchase: post_purchase_upsell, has_post_purchase_upsell, token.

Each item: name, variant_name, quantity, unit_price_formatted, line_total_formatted. The _formatted values are already text with the currency; print them as they are.

logged_in, id, name, email, phone, address, orders_count, total_spent, csrf_token (only for the sign-out form).

url, src, alt, width, height, aspect_ratio. Size them with image_url or image_tag:

{product.featured_image | image_tag(product.title, 600, 'card__img')}
<img src={product.featured_image | image_url(1200)} alt={product.featured_image.alt} />

linklists['main-menu']: title, handle, links, links_count, levels. Each link: title, url, type, active (it’s the current page), child_active, links (for dropdowns).

title, handle, url, content (HTML), excerpt, template.