Guide
Shopify Liquid Cheat Sheet 2026
Product and Variant Objects
Available on product templates, in collection loops, and through all_products['handle'].
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 }}product.id / title / handle / url
Core identifiers.
<a href="{{ product.url }}">{{ product.title }}</a>product.type / product.vendor
The product type and vendor.
{{ product.vendor | link_to_vendor }}product.price / price_min / price_max
Prices in cents (subunits). price equals price_min.
From {{ product.price_min | money }}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 %}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 }}product.featured_image / images / media
The main image, all images, and all media including video and 3D. Prefer media in modern galleries.
{% for media in product.media %}{{ media | image_url: width: 800 | image_tag }}{% endfor %}product.description / product.content
The product description (HTML). content is an alias.
{{ product.description }}product.variants
All variants of the product.
{% for variant in product.variants %}{{ variant.title }}{% endfor %}product.available
true if at least one variant can be purchased.
{% unless product.available %}Sold out{% endunless %}product.template_suffix
The alternate template assigned to the product, if any.
{{ product.template_suffix }}product.selected_variant
The variant selected with the ?variant= URL parameter, otherwise nil.
{{ product.selected_variant.title }}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 }}product.collections / product.tags
The collections the product belongs to, and its tags.
{{ product.tags | join: ', ' }}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 %}variant.id / title / sku
Core variant identifiers. Post variant.id to add to cart.
<input type="hidden" name="id" value="{{ variant.id }}">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>variant.image
The image assigned to the variant.
{{ variant.image | image_url: width: 400 | image_tag }}variant.available
true if the variant can be purchased.
{% if variant.available %}Add to cart{% else %}Sold out{% endif %}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 %}variant.weight
The variant's weight in grams — format with weight_with_unit.
{{ variant.weight | weight_with_unit }}variant.option1 / option2 / option3
The variant's value for each product option.
{{ variant.option1 }} / {{ variant.option2 }}Shopify stores that convert, rank higher, scale and sell more.
Builds, SEO and CRO from a Shopify Plus partner team.
Monthly send · Unsubscribe any time · Privacy policy
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




