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
attachments
Returns the product attachments links.
breadcrumbs
Returns the caetegory breadcrumbs
combined_listing
Returns the combined_listing.
compatible
Returns the compatible products
created_at
Returns the creation date.
custom_fields
Returns product custom fields.
customer_can_review
Returns true if customer can review the product.
customer_has_purchased
Returns true if customer has purchased the product.
customer_has_reviewed
Returns true if customer has reviewed the product.
default_or_selected_variant
Return the selected variant or the default one if none is selected.
deliverer
Returns the deliverer
description
Returns the description.
featured_image
Returns product featured (first available) image.
featured_media
Returns the featured (first available) media.
featured_video
Returns the featured (first available) video.
first_available_variant
Returns the first available variant.
handle
Returns the handle.
has_only_default_variant
Returns true if product has only default variant.
id
Returns the id.
image
Returns product main image url. This is an alias for featured_image.
images
Returns the images as an array of
- thumb
- original
in_customers_wishlist?
Returns true if products is in customers wishlist.
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.
manufacturer
Returns the manufacturer.
max_rating
Returns the maximum rating
media
Returns the product media, concatted from videos and images properties with additional type field describing the type of the media.
options
Returns the options handles.
options_by_handle
Returns array of options indexed by handle.
options_with_values
Returns array of options.
product_groups
Returns the assiociated product_groups
rate
Returns the tax rate.
rating
Returns the rating
related
Returns the related products
return_policy_time_limit
Returns the product return policy time limit in days.
review_count
Returns the review count
reviews
Returns the reviews
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_approval
Returns true reviews are approved before published.
reviews_require_purchase
Returns true if product must be purchased before review can be made.
selected_variant
Returns the selected variant.
seo_description
Returns description for search engines.
seo_keywords
Returns keywords for search engines.
seo_title
Returns title for search engines.
short_description
Returns the short description.
similar
Returns the similar products
size_chart
Returns the size chart.
tags
Returns product tags.
taxonomy
Returns the taxonomy.
title
Returns the title.
updated_at
Returns the last updated date.
variants
Returns the variants.
videos
Returns the videos