Difference between revisions of "Liquid Template Variables - product"

From Spiffy Stores Knowledge Base

m
Line 68: Line 68:
  
 
Returns the description of this product.
 
Returns the description of this product.
 +
 +
== <code>product.content</code> ==
 +
 +
This is an alias of description.
  
 
== <code>product.variants</code> ==
 
== <code>product.variants</code> ==

Revision as of 14:23, 11 March 2010

The liquid template variable product has the following attributes:

product.id

Returns the unique internal number of the product.

This is normally only for internal usage.

product.handle

This is the product handle. The handle uniquely identifies the product in the URL address.

The handle is usually the product's title in lower case with all blanks replaced by a dash. "Red Hat" would have the handle "red-hat".

product.title

Returns the title of this product.

product.type

Returns the type of this product, for example, "t-shirt" or "garden gnome".

product.vendor

Returns the vendor of this product, such as "Spiffy Stores" or "Acme Tools".

product.price

Returns the price for this product. By default this is the minimum price.

product.price_min

Returns the minimum price for this product.

product.price_max

Returns the minimum price for this product.

product.price_varies

Returns true if the price_min is different from price_max.

product.compare_at_price_min

Returns a "compare at" price, that is, the recommended retail price for the least expensive variant of this product.

product.compare_at_price_max

Returns a "compare at" price, that is, the recommended retail price for the most expensive variant of this product

product.compare_at_price_varies

Returns true if the compare_at_price_min is different from compare_at_price_max.

product.featured_image

Returns the relative URL path of the featured image.

product.images

Returns a collection of all image filenames for this product.

product.image_count

Returns the number of images for this product.

product.description

Returns the description of this product.

product.content

This is an alias of description.

product.variants

Returns a collection of all of this product's variants.

product.available

Returns false if all variants' quantities are zero and their policies are set to "stop selling when sold out".

product.collections

Returns a list of collections that this product belongs to.

product.tags

Returns a list of the product's tags (represented by simple strings).

product.url

The is the relative URL address of the product.

<a href="{{ product.url }}"><img src="{{ product.featured_image | product_img_url: 'small' }}" /></a>