QUANTM7 Docs

Product

The product object and all of its properties.

The product object holds everything about a single product. It is available on product pages, and you can also access it inside loops when working with collections.

Properties

PropertyTypeDescription
product.idstringThe unique ID for this product
product.titlestringThe product title
product.handlestringThe URL slug (e.g. classic-gold-ring)
product.descriptionstringThe full HTML description
product.contentstringAlias for description
product.typestringThe product type: physical, digital, or service
product.vendorstringThe brand or vendor name
product.urlstringThe URL path to the product page
product.availablebooleantrue if at least one variant is in stock
product.published_atstringThe date the product was published
product.created_atstringThe date the product was created
product.has_only_default_variantbooleantrue if the product has just one variant

Pricing

Prices are in the smallest currency unit (pence, cents). Use the money filter to format them.

PropertyTypeDescription
product.pricenumberThe current price (lowest variant)
product.price_minnumberThe lowest variant price
product.price_maxnumberThe highest variant price
product.compare_at_pricenumberThe compare-at price, if set
<p class="price">{{ product.price | money }}</p>

{% if product.compare_at_price > product.price %}
  <p class="compare-price">Was {{ product.compare_at_price | money }}</p>
{% endif %}

Price ranges

When a product has variants at different prices, show a range:

{% if product.price_min != product.price_max %}
  <p>{{ product.price_min | money }} – {{ product.price_max | money }}</p>
{% else %}
  <p>{{ product.price | money }}</p>
{% endif %}

Images

PropertyTypeDescription
product.featured_imageimageThe first image
product.imagesarrayAll product images

Each image object has src, alt, width, height, and position properties. See the Image object for details.

{% if product.featured_image %}
  {{ product.featured_image | image_tag }}
{% endif %}

{% for image in product.images %}
  <img src="{{ image | img_url: '400x400' }}" alt="{{ image.alt }}" />
{% endfor %}

Variants

PropertyTypeDescription
product.variantsarrayAll variants for this product
product.optionsarrayOption names (e.g. ["Size", "Colour"])
product.selected_variantvariantThe variant the visitor has picked, if any

See the Variant object for all variant properties.

<select name="variant_id">
  {% for variant in product.variants %}
    <option value="{{ variant.id }}" {% unless variant.available %}disabled{% endunless %}>
      {{ variant.title }} – {{ variant.price | money }}
    </option>
  {% endfor %}
</select>

Tags and collections

PropertyTypeDescription
product.tagsarrayTags assigned to this product
product.collectionsarrayCollections this product belongs to
{% if product.tags contains 'sale' %}
  <span class="badge">On Sale</span>
{% endif %}

Metafields

PropertyTypeDescription
product.metafieldsobjectCustom data fields set in the admin

Access metafields by namespace and key:

{% if product.metafields.custom.care_instructions %}
  <p>{{ product.metafields.custom.care_instructions }}</p>
{% endif %}

Full example

A product card that shows the image, title, price, and a sale badge:

<div class="product-card">
  {% if product.featured_image %}
    <a href="{{ product.url }}">
      {{ product.featured_image | image_tag: class: 'product-card__image' }}
    </a>
  {% endif %}

  <h3><a href="{{ product.url }}">{{ product.title }}</a></h3>
  <p>{{ product.vendor }}</p>

  {% if product.compare_at_price > product.price %}
    <span class="price price--sale">{{ product.price | money }}</span>
    <span class="price price--compare">{{ product.compare_at_price | money }}</span>
  {% else %}
    <span class="price">{{ product.price | money }}</span>
  {% endif %}

  {% if product.tags contains 'new' %}
    <span class="badge">New</span>
  {% endif %}
</div>

On this page