7.4 KiB
layout, title, nav
| layout | title | nav | ||
|---|---|---|---|---|
| default | product |
|
product
The product object has the following attributes:
{% anchor_link "product.available", "product-available" %}
Returns true if a product is available for purchase. Returns falseif all of the products variants' inventory_quantity values are zero or less, and their inventory_policy is not set to "Allow users to purchase this item, even if it is no longer in stock."
{% anchor_link "product.collections", "product-collections" %}
Returns an array of all of the collections a product belongs to.
Input
{% for collection in product.collections %} {{ collection.title }} {% endfor %} {% endraw %}{% endhighlight %}
Output
Sale Shirts Spring {% endraw %}{% endhighlight %}
{% anchor_link "product.compare_at_price_max", "product-compare_at_price_max" %}
Returns the highest compare at price. Use one of the money filters to return the value in a monetary format.
{% anchor_link "product.compare_at_price_min", "product-compare_at_price_min" %}
Returns the lowest compare at price. Use one of the money filters to return the value in a monetary format.
{% anchor_link "product.compare_at_price_varies", "product-compare_at_price_varies" %}
Returns true if the compare_at_price_min is different from the compare_at_price_max. Returns false if they are the same.
{% anchor_link "product.content", "product-content" %}
Returns the description of the product. Alias for product.description.
{% anchor_link "product.description", "product-description" %}
Returns the description of the product.
{% anchor_link "product.featured_image", "product-featured_image" %}
Returns the relative URL of the product's featured image.
{% anchor_link "product.handle", "product-handle" %}
Returns the handle of a product.
{% anchor_link "product.id", "product-id" %}
Returns the id of the product.
{% anchor_link "product.images", "product-images" %}
Returns an array of the product's images. Use the product_img_url filter to link to the product image on Shopify's Content Delivery Network.
Input
Output
{% anchor_link "product.options", "product-options" %}
Returns an array of the product's options.
Input
Output
Use size if you need to determine how many options a product has.
Input
Output
{% anchor_link "product.price", "product-price" %}
Returns the price of the product. Use one of the money filters to return the value in a monetary format.
{% anchor_link "product.price_max", "product-price_max" %}
Returns the highest price of the product. Use one of the money filters to return the value in a monetary format.
{% anchor_link "product.price_min", "product-price_min" %}
Returns the lowest price of the product. Use one of the money filters to return the value in a monetary format.
{% anchor_link "product.price_varies", "product-price_varies" %}
Returns true if the product's variants have varying prices. Returns false if all of the product's variants have the same price.
{% anchor_link "product.tags", "product-tags" %}
Returns an array of all of the product's tags. The tags are returned in alphabetical order.
Input
Output
{% anchor_link "product.template_suffix", "product-template_suffix" %}
Returns the name of the custom product template assigned to the product, without the product. prefix nor the .liquid suffix. Returns nil if a custom template is not assigned to the product.
Input
Output
{% anchor_link "product.title", "product-title" %}
Returns the title of the product.
{% anchor_link "product.type", "product-type" %}
Returns the type of the product.
{% anchor_link "product.url", "product-url" %}
Returns the relative URL of the product.
Input
Output
{% anchor_link "product.variants", "product-variants" %}
Returns an array the product's variants.
{% anchor_link "product.vendor", "product-vendor" %}
Returns the vendor of the product.


