--- title: "Liquid objects: product" description: A [product](https://help.shopify.com/manual/products) in the store. api_name: liquid source_url: html: https://shopify.dev/docs/api/liquid/objects/product md: https://shopify.dev/docs/api/liquid/objects/product.md --- # product A [product](https://help.shopify.com/manual/products) in the store. ## Properties * * available [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) * Returns `true` if at least one of the variants of the product is available. Returns `false` if not. For a variant to be available, it needs to meet one of the following criteria: * The `variant.inventory_quantity` is greater than 0. * The `variant.inventory_policy` is set to `continue`. * The `variant.inventory_management` is `nil`. * The variant has an associated [delivery profile](https://shopify.dev/docs/apps/selling-strategies/purchase-options/deferred/shipping-delivery/delivery-profiles) with a valid shipping rate. * category [taxonomy\_category](https://shopify.dev/docs/api/liquid/objects/taxonomy_category) * The taxonomy category for the product * collections array of [collection](https://shopify.dev/docs/api/liquid/objects/collection) * The collections that the product belongs to. Note Collections that aren't [available](https://help.shopify.com/manual/products/collections/make-collections-available) on the Online Store sales channel aren't included. * compare\_​at\_​price [number](https://shopify.dev/docs/api/liquid/basics#number) * 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. For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000. Tip Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. * compare\_​at\_​price\_​max [number](https://shopify.dev/docs/api/liquid/basics#number) * 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. For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000. Tip Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. * compare\_​at\_​price\_​min [number](https://shopify.dev/docs/api/liquid/basics#number) * 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. For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000. Tip Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. * compare\_​at\_​price\_​varies [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) * Returns `true` if the variant **compare at** prices of the product vary. Returns `false` if not. * content [string](https://shopify.dev/docs/api/liquid/basics#string) * The description of the product. Note This is the same value as [`product.description`](https://shopify.dev/docs/api/liquid/objects/product#product-description). * created\_​at [string](https://shopify.dev/docs/api/liquid/basics#string) * A timestamp for when the product was created. Tip Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. * description [string](https://shopify.dev/docs/api/liquid/basics#string) * The description of the product. Note This is the same value as [`product.content`](https://shopify.dev/docs/api/liquid/objects/product#product-content). * featured\_​image [image](https://shopify.dev/docs/api/liquid/objects/image) * The first (featured) image attached to the product. * featured\_​media [media](https://shopify.dev/docs/api/liquid/objects/media) * The first (featured) media attached to the product. Tip You can use [media filters](https://shopify.dev/docs/api/liquid/filters/media-filters) to output media URLs and displays. To learn about how to include media in your theme, refer to [Support product media](https://shopify.dev/themes/product-merchandising/media/support-media). * first\_​available\_​variant [variant](https://shopify.dev/docs/api/liquid/objects/variant) * The first available variant of the product. For a variant to be available, it needs to meet one of the following criteria: * The `variant.inventory_quantity` is greater than 0. * The `variant.inventory_policy` is set to `continue`. * The `variant.inventory_management` is `nil`. * gift\_​card? [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) * Returns `true` if the product is a gift card. Returns `false` if not. * handle [string](https://shopify.dev/docs/api/liquid/basics#string) * The [handle](https://shopify.dev/docs/api/liquid/basics#handles) of the product. * has\_​only\_​default\_​variant [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) * Returns `true` if the product doesn't have any options. Returns `false` if not. * id [number](https://shopify.dev/docs/api/liquid/basics#number) * The ID of the product. * images array of [image](https://shopify.dev/docs/api/liquid/objects/image) * The images attached to the product. * media array of [media](https://shopify.dev/docs/api/liquid/objects/media) * The media attached to the product, sorted by the date it was added to the product. Tip You can use [media filters](https://shopify.dev/docs/api/liquid/filters/media-filters) to output media URLs and displays. To learn about how to include media in your theme, refer to [Support product media](https://shopify.dev/themes/product-merchandising/media/support-media). * metafields * The [metafields](https://shopify.dev/docs/api/liquid/objects/metafield) applied to the product. Tip To learn about how to create metafields, refer to [Create and manage metafields](https://shopify.dev/apps/metafields/manage) or visit the [Shopify Help Center](https://help.shopify.com/manual/metafields). * options array of [string](https://shopify.dev/docs/api/liquid/basics#string) * The option names of the product. ![](https://shopify.dev/images/icons/32/lightbulbscroll.png)![](https://shopify.dev/images/icons/32/lightbulbscroll-dark.png)ExampleOutput the options You can use the [`size` filter](https://shopify.dev/docs/api/liquid/filters/size) with dot notation to determine how many options a product has. ```liquid {% if product.options.size > 0 -%} {% for option in product.options -%} - {{ option }} {%- endfor %} {%- endif %} ``` ##### Code ``` {% if product.options.size > 0 -%} {% for option in product.options -%} - {{ option }} {%- endfor %} {%- endif %} ``` ##### Data ``` { "product": { "options": [ "Size", "Strength" ] } } ``` ## Output ```html - Size - Strength ``` * options\_​by\_​name * Allows you to access a specific [product option](https://shopify.dev/docs/api/liquid/objects/product_option) by its name. ![](https://shopify.dev/images/icons/32/lightbulbscroll.png)![](https://shopify.dev/images/icons/32/lightbulbscroll-dark.png)ExampleOutput the values for a specific option When accessing a specific option, the name is case-insensitive. ```liquid ``` ##### Code ``` ``` ##### Data ``` { "product": { "options_by_name": {} } } ``` ## Output ```html ``` * options\_​with\_​values array of [product\_option](https://shopify.dev/docs/api/liquid/objects/product_option) * The options on the product. * price [number](https://shopify.dev/docs/api/liquid/basics#number) * The lowest price of any variants of the product in the currency's subunit. Note This is the same value as [`product.price_min`](https://shopify.dev/docs/api/liquid/objects/product#product-price_min). The value is output in the customer's local (presentment) currency. For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000. Tip Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. * price\_​max [number](https://shopify.dev/docs/api/liquid/basics#number) * 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. For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000. Tip Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. * price\_​min [number](https://shopify.dev/docs/api/liquid/basics#number) * The lowest price of any variants of the product in the currency's subunit. Note This is the same value as [`product.price`](https://shopify.dev/docs/api/liquid/objects/product#product-price). The value is output in the customer's local (presentment) currency. For currencies without subunits, such as JPY and KRW, tenths and hundredths of a unit are appended. For example, 1000 Japanese yen is output as 100000. Tip Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. * price\_​varies [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) * Returns `true` if the product's variant prices vary. Returns `false` if not. * published\_​at [string](https://shopify.dev/docs/api/liquid/basics#string) * A timestamp for when the product was published. Tip Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. * quantity\_​price\_​breaks\_​configured? [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) * Returns `true` if the product has at least one variant with quantity price breaks in the current customer context. Returns `false` if not. * requires\_​selling\_​plan [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) * 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://shopify.dev/docs/api/liquid/objects/variant#variant-requires_selling_plan) is `true`. * selected\_​or\_​first\_​available\_​selling\_​plan\_​allocation [selling\_plan\_allocation](https://shopify.dev/docs/api/liquid/objects/selling_plan_allocation) * The currently selected, or first available, selling plan allocation. The following logic is used to determine which selling plan allocation is returned: | Selling plan allocation | Return criteria | | - | - | | The currently selected allocation | Returned if a variant and selling plan are selected. The selected variant is determined by the `variant` URL parameter, and the selected selling plan is determined by the `selling_plan` URL parameter. | | The first allocation on the first available variant | Returned if no allocation is currently selected. | | The first allocation on the first variant | Returned if no allocation is currently selected, and there are no available variants. | If the product doesn't have any selling plans, then `nil` is returned. * selected\_​or\_​first\_​available\_​variant [variant](https://shopify.dev/docs/api/liquid/objects/variant) * 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. For a variant to be available, it needs to meet one of the following criteria: * The `variant.inventory_quantity` is greater than 0. * The `variant.inventory_policy` is set to `continue`. * The `variant.inventory_management` is `nil`. * selected\_​selling\_​plan [selling\_plan](https://shopify.dev/docs/api/liquid/objects/selling_plan) * The currently selected selling plan. If no selling plan is selected, then `nil` is returned. Note The selected selling plan is determined by the `selling_plan` URL parameter. * selected\_​selling\_​plan\_​allocation [selling\_plan\_allocation](https://shopify.dev/docs/api/liquid/objects/selling_plan_allocation) * The currently selected selling plan allocation for the currently selected variant. If no variant and selling plan are selected, then `nil` is returned. Note The selected variant is determined by the `variant` URL parameter, and the selected selling plan is determined by the `selling_plan` URL parameter. * selected\_​variant [variant](https://shopify.dev/docs/api/liquid/objects/variant) * The currently selected variant of the product. If no variant is currently selected, then `nil` is returned. Note The selected variant is determined by the `variant` URL parameter. This URL parameter is available on product pages URLs only. * selling\_​plan\_​groups array of [selling\_plan\_group](https://shopify.dev/docs/api/liquid/objects/selling_plan_group) * The selling plan groups that the variants of the product are included in. * tags array of [string](https://shopify.dev/docs/api/liquid/basics#string) * The [tags](https://help.shopify.com/manual/shopify-admin/productivity-tools/using-tags) of the product. Note The tags are returned in alphabetical order. * template\_​suffix [string](https://shopify.dev/docs/api/liquid/basics#string) * The name of the [custom template](https://shopify.dev/themes/architecture/templates#alternate-templates) of the product. The name doesn't include the `product.` prefix, or the file extension (`.json` or `.liquid`). If a custom template isn't assigned to the product, then `nil` is returned. * title [string](https://shopify.dev/docs/api/liquid/basics#string) * The title of the product. * type [string](https://shopify.dev/docs/api/liquid/basics#string) * The type of the product. * url [string](https://shopify.dev/docs/api/liquid/basics#string) * The relative URL of the product. If a product is [recommended](https://shopify.dev/docs/themes/product-merchandising/recommendations), then the URL contains tracking parameters: ```liquid /products/gorgeous-wooden-computer?pr_choice=default&pr_prod_strat=description&pr_rec_pid=13&pr_ref_pid=17&pr_seq=alternating ``` * variants array of [variant](https://shopify.dev/docs/api/liquid/objects/variant) * The variants of the product. Note Returns a maximum of 250 variants when unpaginated. Tip: Use the [paginate](https://shopify.dev/docs/api/liquid/tags/paginate) tag to choose how many variants to show per page, up to a limit of 50. * variants\_​count [number](https://shopify.dev/docs/api/liquid/basics#number) * The total number of variants for the product. * vendor [string](https://shopify.dev/docs/api/liquid/basics#string) * The vendor of the product. ```json { "available": true, "category": {}, "collections": [], "compare_at_price": "25.00", "compare_at_price_max": "25.00", "compare_at_price_min": "25.00", "compare_at_price_varies": false, "content": "

Are you low on health? Well we've got the potion just for you!

\n

Just need a top up? Almost dead? In between? No need to worry because we have a range of sizes and strengths!

", "created_at": "2022-04-13 14:46:16 -0400", "description": "

Are you low on health? Well we've got the potion just for you!

\n

Just need a top up? Almost dead? In between? No need to worry because we have a range of sizes and strengths!

", "featured_image": {}, "featured_media": {}, "first_available_variant": {}, "gift_card?": false, "handle": "health-potion", "has_only_default_variant": false, "id": 6786188247105, "images": [], "media": [], "metafields": {}, "options": [ "Size", "Strength" ], "options_by_name": {}, "options_with_values": [], "price": "10.00", "price_max": "22.00", "price_min": "10.00", "price_varies": true, "published_at": "2022-04-13 14:53:34 -0400", "quantity_price_breaks_configured?": false, "requires_selling_plan": false, "selected_or_first_available_selling_plan_allocation": {}, "selected_or_first_available_variant": {}, "selected_selling_plan": null, "selected_selling_plan_allocation": null, "selected_variant": null, "selling_plan_groups": [], "tags": [ "healing" ], "template_suffix": "", "title": "Health potion", "type": {}, "url": {}, "variants": [], "variants_count": 9, "vendor": "Polina's Potent Potions" } ``` ##### Example ``` { "available": true, "category": {}, "collections": [], "compare_at_price": "25.00", "compare_at_price_max": "25.00", "compare_at_price_min": "25.00", "compare_at_price_varies": false, "content": "

Are you low on health? Well we've got the potion just for you!

\n

Just need a top up? Almost dead? In between? No need to worry because we have a range of sizes and strengths!

", "created_at": "2022-04-13 14:46:16 -0400", "description": "

Are you low on health? Well we've got the potion just for you!

\n

Just need a top up? Almost dead? In between? No need to worry because we have a range of sizes and strengths!

", "featured_image": {}, "featured_media": {}, "first_available_variant": {}, "gift_card?": false, "handle": "health-potion", "has_only_default_variant": false, "id": 6786188247105, "images": [], "media": [], "metafields": {}, "options": [ "Size", "Strength" ], "options_by_name": {}, "options_with_values": [], "price": "10.00", "price_max": "22.00", "price_min": "10.00", "price_varies": true, "published_at": "2022-04-13 14:53:34 -0400", "quantity_price_breaks_configured?": false, "requires_selling_plan": false, "selected_or_first_available_selling_plan_allocation": {}, "selected_or_first_available_variant": {}, "selected_selling_plan": null, "selected_selling_plan_allocation": null, "selected_variant": null, "selling_plan_groups": [], "tags": [ "healing" ], "template_suffix": "", "title": "Health potion", "type": {}, "url": {}, "variants": [], "variants_count": 9, "vendor": "Polina's Potent Potions" } ``` ## Templates using product [![](https://shopify.dev/images/icons/32/themes.png)![](https://shopify.dev/images/icons/32/themes-dark.png)](https://shopify.dev/themes/architecture/templates/product) [Theme architectureproduct template](https://shopify.dev/themes/architecture/templates/product)