---
title: "product"

doc_type: static
doc_category: static
doc_version: v20260901
source_url:
  html: 'https://developer.shopline.com/docs/handlebars/objects/product'
  md: 'https://developer.shopline.com/docs/handlebars/objects/product.md'
---


# product

<div className="code-flex">

<div>
  {/* TODO 缺少链接 */}
  <ObjectSummary>
    A product in the store.
  </ObjectSummary>

  #### Properties

  <ObjectProperty
    name="available"
    types={["boolean"]}
  >
    <ObjectSummary>
      Returns `true` if at least one of the variants of the product is available. Returns `false` if not.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="collections"
    types={[<Mdx>array of [collection](https://developer.shopline.com/docs/handlebars/objects/collection.md)</Mdx>]}
  >
    {/* TODO 缺少链接 */}
    <ObjectSummary>
      The collections that the product belongs to.
  > **Note**
>
> Collections that aren't available on the Online Store sales channel aren't included.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="compare_at_price"
    types={["number"]}
  >
    <ObjectSummary>
      The lowest **compare at** price of any variants of the product in the currency's subunit.

      The value is output in the customer's local (presentment) currency.
  > **Tip**
>
> Use [money helper](https://developer.shopline.com/docs/handlebars/helpers/money/money.md) to output a formatted price.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="compare_at_price_max"
    types={["number"]}
  >
    <ObjectSummary>
      The highest **compare at** price of any variants of the product in the currency's subunit.

      The value is output in the customer's local (presentment) currency.
  > **Tip**
>
> Use [money helper](https://developer.shopline.com/docs/handlebars/helpers/money/money.md) to output a formatted price.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="compare_at_price_min"
    types={["number"]}
  >
    <ObjectSummary>
      The lowest **compare at** price of any variants of the product in the currency's subunit. This is the same as `product.compare_at_price`.

      The value is output in the customer's local (presentment) currency.
  > **Tip**
>
> Use [money helper](https://developer.shopline.com/docs/handlebars/helpers/money/money.md) to output a formatted price.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="compare_at_price_varies"
    types={["boolean"]}
  >
    <ObjectSummary>
      Returns `true` if the variant compare at prices of the product vary. Returns `false` if not.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="created_at"
    types={["string"]}
  >
    <ObjectSummary>
      A timestamp for when the product was created.
  > **Tip**
>
> Use the [date helper](https://developer.shopline.com/docs/handlebars/helpers/format/date.md) to format the timestamp.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="description"
    types={["string"]}
  >
    <ObjectSummary>
      The description of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="featured_image"
    types={["image"]}
  >
    <ObjectSummary>
      The first (featured) image attached to the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="featured_media"
    types={["media"]}
  >
    {/* TODO 缺少链接 */}
    <ObjectSummary>
      The first (featured) media attached to the product.
  > **Tip**
>
> You can use media helpers to output media URLs and displays. To learn about how to include media in your theme, refer to Support product media.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="first_available_variant"
    types={["variant"]}
  >
    <ObjectSummary>
      The first available variant of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="gift_card"
    types={["boolean"]}
  >
    <ObjectSummary>
      Returns `true` if the product is a gift card. Returns `false` if not.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="handle"
    types={["string"]}
  >
    {/* TODO 缺少链接 */}
    <ObjectSummary>
      The handle of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="has_only_default_variant"
    types={["boolean"]}
  >
    <ObjectSummary>
      Returns `true` if the product doesn't have any options. Returns `false` if not.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="id"
    types={["string"]}
  >
    <ObjectSummary>
      The ID of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="images"
    types={["array of image"]}
  >
    <ObjectSummary>
      The images attached to the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="media"
    types={["array of media"]}
  >
    <ObjectSummary>
      The media attached to the product, sorted by the date it was added to the product.
  > **Tip**
>
> You can use media helpers to output media URLs and displays. To learn about how to include media in your theme, refer to Support product media.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="metafields"
  >
    {/* TODO 缺少链接 */}
    <ObjectSummary>
      The metafields applied to the product.
  > **Tip**
>
> To learn about how to create metafields, refer to Create and manage metafields or visit the Shopline Help Center.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="options"
    types={["array of string"]}
  >
    <ObjectSummary>
      The option names of the product.
    </ObjectSummary>

    <Example data={['product.options']}>
      ```handlebars
      {{#if product.options.length '>' 0}}
        {{#each product.options as |option|}}
          - {{option}}
        {{/each}}
      {{/if}}
      ```
    </Example>
  </ObjectProperty>
  <ObjectProperty
    name="options_by_name"
  >
    <ObjectSummary>
      Allows you to access a specific [product option](https://developer.shopline.com/docs/handlebars/objects/product-option.md) by its name.
    </ObjectSummary>


    <Example data={['product.options_by_name']} layout="vertical">
      ```handlebars
      <label>
        Strength
        <select>
          {{#each product.options_by_name.strength.values as |value|}}
            <option>{{ value }}</option>
          {{/each}}
        </select>
      </label>
      ```
    </Example>
  </ObjectProperty>
  <ObjectProperty
    name="options_with_values"
    types={[<Mdx>array of [product_option](https://developer.shopline.com/docs/handlebars/objects/product-option.md)</Mdx>]}
  >
    <ObjectSummary>
      The options on the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="price"
    types={["number"]}
  >
    <ObjectSummary>
      The lowest price of any variants of the product in the currency's subunit.
  > **Note**
>
> This is the same value as `product.price_min`.
      The value is output in the customer's local (presentment) currency.
  > **Tip**
>
> Use [money helpers](https://developer.shopline.com/docs/handlebars/helpers/money/money.md) to output a formatted price.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="price_max"
    types={["number"]}
  >
    <ObjectSummary>
      The highest price of any variants of the product in the currency's subunit.

      The value is output in the customer's local (presentment) currency.
  > **Tip**
>
> Use [money helpers](https://developer.shopline.com/docs/handlebars/helpers/money/money.md) to output a formatted price.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="price_min"
    types={["number"]}
  >
    <ObjectSummary>
      The lowest price of any variants of the product in the currency's subunit.
  > **Note**
>
> This is the same value as `product.price`.
      The value is output in the customer's local (presentment) currency.
  > **Tip**
>
> Use [money helpers](https://developer.shopline.com/docs/handlebars/helpers/money/money.md) to output a formatted price.
    </ObjectSummary>
  </ObjectProperty>
    {/*<ObjectProperty
    name="price_varies"
    types={["boolean"]}
  >
    <ObjectSummary>
      Returns `false` if the product's variant prices vary. Returns `true` if not.
    </ObjectSummary>
  </ObjectProperty>*/}
  <ObjectProperty
    name="published_at"
    types={["string"]}
  >
    <ObjectSummary>
      A timestamp for when the product was published.
  > **Tip**
>
> Use the [date helper](https://developer.shopline.com/docs/handlebars/helpers/format/date.md) to format the timestamp.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="requires_selling_plan"
    types={["boolean"]}
  >
    <ObjectSummary>
      Returns `true` if all of the variants of the product require a selling plan. Returns `false` if not.
  > **Note**
>
> A variant requires a selling plan if [variant.requires_selling_plan](https://developer.shopline.com/docs/handlebars/objects/variant.md) is `true`.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="selected_or_first_available_variant"
    types={[<Mdx>[variant](https://developer.shopline.com/docs/handlebars/objects/variant.md)</Mdx>]}
  >
    <ObjectSummary>
      The currently selected or first available variant of the product.
  > **Note**
>
> The selected variant is determined by the `variant` URL parameter. The `selected_variant` parameter is available on product pages only.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="selected_variant"
    types={[<Mdx>[variant](https://developer.shopline.com/docs/handlebars/objects/variant.md)</Mdx>]}
  >
    <ObjectSummary>
      The currently selected variant of the product.

      If no variant is currently selected, then `null` is returned.
  > **Note**
>
> The selected variant is determined by the `variant` URL parameter. This URL parameter is available on product pages URLs only.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="selling_plan_groups"
    types={[<Mdx>array of selling_plan_group</Mdx>]}
  >
    <ObjectSummary>
      The selling plan groups that the variants of the product are included in.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="tags"
    types={["array of string"]}
  >
    {/* TODO 缺少链接 */}
    <ObjectSummary>
      The tags of the product.
  > **Note**
>
> The tags are returned in alphabetical order.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="template_suffix"
    types={["string"]}
  >
    {/* TODO 缺少链接 */}
    <ObjectSummary>
      The name of the custom template of the product.

      The name doesn't include the `product.` prefix, or the file extension (`.json` or `.html`).

      If a custom template isn't assigned to the product, then `null` is returned.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="title"
    types={["string"]}
  >
    <ObjectSummary>
      The title of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="type"
    types={["string"]}
  >
    <ObjectSummary>
      The type of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="url"
    types={["string"]}
  >
    <ObjectSummary>
      The relative URL of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="variants"
    types={[<Mdx>array of [variant](https://developer.shopline.com/docs/handlebars/objects/variant.md)</Mdx>]}
  >
    <ObjectSummary>
      The variants of the product.
    </ObjectSummary>
  </ObjectProperty>
  <ObjectProperty
    name="vendor"
    types={["string"]}
  >
    <ObjectSummary>
      The brand of the product.
    </ObjectSummary>
  </ObjectProperty>
</div>

<div>
  <ObjectAccess
    object="product"
    global={false}
    templates={[
      { name: 'product' },
    ]}
    parents={[
      { object: 'collection.products', link: '/docsv2/ec20/hdwvcvrgnfcjf4gq/bgaerupeyfawz4am' },
      { object: 'line_item.product', link: '/docsv2/ec20/hdwvcvrgnfcjf4gq/9y14nnr3jpdahd7s' },
      { object: 'link.object', link: '/docsv2/ec20/hdwvcvrgnfcjf4gq/qefgzrx6wz19e5nb' },
      { object: 'recommendations.products', link: '/docsv2/ec20/hdwvcvrgnfcjf4gq/r66nxe4587phzzrd' },
      { object: 'search.results', link: '/docsv2/ec20/hdwvcvrgnfcjf4gq/mpycfchb778ndf9q' },
      { object: 'variant.product', link: '/docsv2/ec20/hdwvcvrgnfcjf4gq/gjjjhvusthxd5ucy' },
    ]}
  />
</div>

</div>

