All guides

Guide

Shopify Liquid Cheat Sheet 2026

Product and Variant Objects

Available on product templates, in collection loops, and through all_products['handle'].

01

all_products['the-handle']

Access a product by handle from any template. Limited to 20 unique handles per page — use a collection or product list setting for more.

{{ all_products['classic-tee'].title }}
02

product.id / title / handle / url

Core identifiers.

<a href="{{ product.url }}">{{ product.title }}</a>
03

product.type / product.vendor

The product type and vendor.

{{ product.vendor | link_to_vendor }}
04

product.price / price_min / price_max

Prices in cents (subunits). price equals price_min.

From {{ product.price_min | money }}
05

product.compare_at_price_min / compare_at_price_max

The lowest and highest compare-at prices across variants.

{% if product.compare_at_price_min > product.price_min %}On sale{% endif %}
06

product.price_varies / compare_at_price_varies

true when variants have different prices or compare-at prices.

{% if product.price_varies %}From {% endif %}{{ product.price | money }}
08

product.description / product.content

The product description (HTML). content is an alias.

{{ product.description }}
09

product.variants

All variants of the product.

{% for variant in product.variants %}{{ variant.title }}{% endfor %}
10

product.available

true if at least one variant can be purchased.

{% unless product.available %}Sold out{% endunless %}
11

product.template_suffix

The alternate template assigned to the product, if any.

{{ product.template_suffix }}
12

product.selected_variant

The variant selected with the ?variant= URL parameter, otherwise nil.

{{ product.selected_variant.title }}
13

product.selected_or_first_available_variant

The selected variant, or the first available one. The standard default for product forms.

{% assign current = product.selected_or_first_available_variant %}
{{ current.price | money }}
14

product.collections / product.tags

The collections the product belongs to, and its tags.

{{ product.tags | join: ', ' }}
15

product.options / options_with_values

Option names, and option names with their values — use the latter to build variant pickers.

{% for option in product.options_with_values %}
  {{ option.name }}: {{ option.values | join: ', ' }}
{% endfor %}
16

variant.id / title / sku

Core variant identifiers. Post variant.id to add to cart.

<input type="hidden" name="id" value="{{ variant.id }}">
17

variant.price / compare_at_price

The variant's price and compare-at price, in cents.

{{ variant.price | money }} <s>{{ variant.compare_at_price | money }}</s>
18

variant.image

The image assigned to the variant.

{{ variant.image | image_url: width: 400 | image_tag }}
19

variant.available

true if the variant can be purchased.

{% if variant.available %}Add to cart{% else %}Sold out{% endif %}
20

variant.inventory_management / inventory_quantity

Whether Shopify tracks the variant's stock, and the quantity available.

{% if variant.inventory_quantity < 5 %}Only a few left{% endif %}
21

variant.weight

The variant's weight in grams — format with weight_with_unit.

{{ variant.weight | weight_with_unit }}
22

variant.option1 / option2 / option3

The variant's value for each product option.

{{ variant.option1 }} / {{ variant.option2 }}

Shopify experts

Let's talk ecommerce, Shopify & Shopify Plus solutions.

DROPSHIP HUBS helps ecommerce brands build, improve, and grow Shopify stores. We support new builds, migrations, ongoing development, SEO, and conversion optimisation.

Our team can help plan the right approach based on your store, goals, and current challenges.

Get in touch