Product
The product object represents a product in the store, including its details, variants, images, pricing, reviews, and more.
Usage Example
{%- comment -%} Product card example {%- endcomment -%}
<article>
<a href="{{ product | link }}">
<img src="{{ product.featured_image }}" alt="{{ product.title }}" style="max-width:150px;">
<h2>{{ product.title }}</h2>
</a>
<p>{{ product.short_description }}</p>
<p>
{% if product.is_available %}
<strong>{{ product.price | money_with_currency }}</strong>
{% else %}
<span>Out of stock</span>
{% endif %}
</p>
{% if product.rating %}
<p>Rating: {{ product.rating }} / {{ product.max_rating }} ({{ product.review_count }} reviews)</p>
{% endif %}
</article>
{%- comment -%} Product options example {%- endcomment -%}
{% for option in product.options_with_values %}
<label>{{ option.name }}:
<select name="option_{{ option.handle }}">
{% for value in option.values %}
<option value="{{ value.handle }}">{{ value.label }}</option>
{% endfor %}
</select>
</label>
{% endfor %}Properties
handle
Returns the handle.
seo_description
Returns description for search engines.
seo_title
Returns title for search engines.
seo_keywords
Returns keywords for search engines.
id
Returns the id.
combined_listing
Returns the combined_listing.
first_available_variant
Returns the first available variant.
has_only_default_variant
Returns true if product has only default variant.
variants
Returns the variants.
options
Returns the options handles.
options_with_values
Returns array of options.
options_by_handle
Returns array of options indexed by handle.
default_or_selected_variant
Return the selected variant or the default one if none is selected.
selected_variant
Returns the selected variant.
tags
Returns product tags.
custom_fields
Returns product custom fields as CustomFieldDrop objects.
in_preview
Returns true if product is in preview.
is_available
Returns true if product is available for purchase.
is_directly_buyable
Returns true if product can be bought without selecting any attributes.
title
Returns the title.
manufacturer
Returns the manufacturer.
short_description
Returns the short description.
description
Returns the description.
images
Returns the images.
media
Returns the product media, concatted from videos and images properties with additional type field describing the type of the media.
videos
Returns the videos
featured_image
Returns product featured (first available) image.
featured_video
Returns the featured (first available) video.
featured_media
Returns the featured (first available) media.
image
Returns product main image url. This is an alias for featured_image.
compatible
Returns the compatible products
similar
Returns the similar products
related
Returns the related products
deliverer
Returns the deliverer
product_groups
Returns the assiociated product_groups
breadcrumbs
Returns the product group breadcrumbs
return_policy_time_limit
Returns the product return policy time limit in days.
rating
Returns the rating
review_count
Returns the review count
max_rating
Returns the maximum rating
reviews
Returns the reviews
attachments
Returns the product attachments as AttachmentDrop objects.
reviews_are_enabled
Returns true if reviews are enabled for this product.
reviews_require_account
Returns true if creating a review for this product requires an account.
reviews_require_purchase
Returns true if product must be purchased before review can be made.
reviews_require_approval
Returns true reviews are approved before published.
taxonomy
Returns the taxonomy.
size_chart
Returns the size chart.
created_at
Returns the creation date.
updated_at
Returns the last updated date.
rate
Returns the tax rate.
in_customers_wishlist?
Returns true if products is in customers wishlist.
customer_has_reviewed
Returns true if customer has reviewed the product.
customer_can_review
Returns true if customer can review the product.
customer_has_purchased
Returns true if customer has purchased the product.