# Table of Contents - [Liquid reference](#liquid-reference) - [Liquid tags: capture](#liquid-tags-capture) - [Liquid tags: assign](#liquid-tags-assign) - [Liquid tags: liquid](#liquid-tags-liquid) - [Liquid basics](#liquid-basics) - [Liquid objects: product](#liquid-objects-product) - [Liquid objects: articles](#liquid-objects-articles) - [Liquid objects: article](#liquid-objects-article) - [Liquid objects: blog](#liquid-objects-blog) - [Liquid tags: case](#liquid-tags-case) - [Liquid objects: additional_checkout_buttons](#liquid-objects-additional-checkout-buttons) - [Liquid objects: taxonomy_category](#liquid-objects-taxonomy-category) - [Liquid tags: comment](#liquid-tags-comment) - [Liquid tags: decrement](#liquid-tags-decrement) - [Liquid tags: doc](#liquid-tags-doc) - [Liquid objects: all_country_option_tags](#liquid-objects-all-country-option-tags) - [Liquid objects: app](#liquid-objects-app) - [Liquid tags: increment](#liquid-tags-increment) - [Liquid tags: else](#liquid-tags-else) - [Liquid objects: address](#liquid-objects-address) - [Liquid tags: echo](#liquid-tags-echo) - [Liquid objects: blogs](#liquid-objects-blogs) - [Liquid tags: raw](#liquid-tags-raw) - [Liquid filters: money](#liquid-filters-money) - [Liquid objects: canonical_url](#liquid-objects-canonical-url) - [Liquid tags: if](#liquid-tags-if) - [Liquid objects: block](#liquid-objects-block) - [Liquid objects: brand_color](#liquid-objects-brand-color) - [Liquid objects: all_products](#liquid-objects-all-products) - [Liquid tags: unless](#liquid-tags-unless) - [Liquid objects: content_for_header](#liquid-objects-content-for-header) - [Liquid objects: company_address](#liquid-objects-company-address) - [Liquid objects: collections](#liquid-objects-collections) - [Liquid objects: comment](#liquid-objects-comment) - [Liquid objects: brand](#liquid-objects-brand) - [Liquid filters: size](#liquid-filters-size) - [Liquid objects: closest](#liquid-objects-closest) - [Liquid filters: date](#liquid-filters-date) - [Liquid objects: product_option](#liquid-objects-product-option) - [Liquid objects: color_scheme_group](#liquid-objects-color-scheme-group) - [Liquid tags: for](#liquid-tags-for) - [Liquid objects: media](#liquid-objects-media) - [Liquid tags: tablerow](#liquid-tags-tablerow) - [Liquid objects: cart](#liquid-objects-cart) - [Liquid objects: checkout](#liquid-objects-checkout) - [Liquid objects: selling_plan_allocation](#liquid-objects-selling-plan-allocation) - [Liquid objects: currency](#liquid-objects-currency) - [Liquid objects: company_location](#liquid-objects-company-location) - [Liquid objects: color](#liquid-objects-color) - [Liquid objects: image](#liquid-objects-image) - [Liquid objects: customer_payment_method](#liquid-objects-customer-payment-method) - [Liquid objects: current_tags](#liquid-objects-current-tags) - [Liquid objects: content_for_index](#liquid-objects-content-for-index) - [Liquid objects: content_for_layout](#liquid-objects-content-for-layout) - [Liquid objects: color_scheme](#liquid-objects-color-scheme) - [Liquid objects: current_page](#liquid-objects-current-page) - [Liquid objects: handle](#liquid-objects-handle) - [Liquid objects: collection](#liquid-objects-collection) - [Liquid objects: content_for_additional_checkout_buttons](#liquid-objects-content-for-additional-checkout-buttons) - [Liquid objects: discount_application](#liquid-objects-discount-application) - [Liquid objects: instructions](#liquid-objects-instructions) - [Liquid objects: page_image](#liquid-objects-page-image) - [Liquid objects: page_description](#liquid-objects-page-description) - [Liquid objects: page_title](#liquid-objects-page-title) - [Liquid objects: focal_point](#liquid-objects-focal-point) - [Liquid objects: filter](#liquid-objects-filter) - [Liquid objects: country_option_tags](#liquid-objects-country-option-tags) - [Liquid objects: image_presentation](#liquid-objects-image-presentation) - [Liquid objects: pending_payment_instruction_input](#liquid-objects-pending-payment-instruction-input) - [Liquid objects: linklists](#liquid-objects-linklists) - [Liquid objects: metaobject_system](#liquid-objects-metaobject-system) - [Liquid objects: measurement](#liquid-objects-measurement) - [Liquid objects: discount_allocation](#liquid-objects-discount-allocation) - [Liquid objects: form_errors](#liquid-objects-form-errors) - [Liquid objects: metaobjects](#liquid-objects-metaobjects) - [Liquid objects: filter_value_display](#liquid-objects-filter-value-display) - [Liquid objects: images](#liquid-objects-images) - [Liquid objects: policy](#liquid-objects-policy) - [Liquid objects: selling_plan](#liquid-objects-selling-plan) - [Liquid objects: model_source](#liquid-objects-model-source) - [Liquid objects: generic_file](#liquid-objects-generic-file) - [Liquid objects: company](#liquid-objects-company) - [Liquid objects: forloop](#liquid-objects-forloop) - [Liquid objects: fulfillment](#liquid-objects-fulfillment) - [Liquid objects: selling_plan_group](#liquid-objects-selling-plan-group) - [Liquid objects: discount](#liquid-objects-discount) - [Liquid objects: linklist](#liquid-objects-linklist) - [Liquid objects: rating](#liquid-objects-rating) - [Liquid objects: powered_by_link](#liquid-objects-powered-by-link) - [Liquid objects: rule](#liquid-objects-rule) - [Liquid objects: location](#liquid-objects-location) - [Liquid filters: external_video_tag](#liquid-filters-external-video-tag) - [Liquid objects: market](#liquid-objects-market) - [Liquid objects: parent_relationship](#liquid-objects-parent-relationship) - [Liquid objects: recipient](#liquid-objects-recipient) - [Liquid objects: script](#liquid-objects-script) - [Liquid objects: group](#liquid-objects-group) - [Liquid objects: metaobject_definition](#liquid-objects-metaobject-definition) - [Liquid objects: part](#liquid-objects-part) - [Liquid objects: country](#liquid-objects-country) - [Liquid objects: recommendations](#liquid-objects-recommendations) - [Liquid objects: robots](#liquid-objects-robots) - [Liquid objects: quantity_price_break](#liquid-objects-quantity-price-break) - [Liquid objects: quantity_rule](#liquid-objects-quantity-rule) - [Liquid objects: shop_locale](#liquid-objects-shop-locale) - [Liquid objects: pages](#liquid-objects-pages) - [Liquid objects: page](#liquid-objects-page) --- # Liquid reference [Skip to main content](https://shopify.dev/docs/api/liquid#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window Liquid reference ================ Liquid is a template language created by Shopify. It's available as an [open source project](https://shopify.github.io/liquid/) on GitHub, and is used by many different software projects and companies. This reference documents the Liquid tags, filters, and objects that you can use to build [Shopify Themes](https://shopify.dev/themes) . Ask assistant [Anchor to What is a template language?](https://shopify.dev/docs/api/liquid#what-is-a-template-language) What is a template language? ------------------------------------------------------------------------------------------------------------------------------------------ A template language allows you to create a single template to host static content, and dynamically insert information depending on where the template is rendered. For example, you can create a product template that hosts all of your standard product attributes, such as the product image, title, and price. That template can then dynamically render those attributes with the appropriate content, depending on the current product being viewed. * * * [Anchor to Variations of Liquid](https://shopify.dev/docs/api/liquid#variations-of-liquid) Variations of Liquid ------------------------------------------------------------------------------------------------------------------- The variation of Liquid in this reference extends the open-source version of Liquid for use with [Shopify themes](https://shopify.dev/themes) . It includes tags, filters, and objects that can be used to render objects specific to Shopify stores and storefront functionality. Shopify also uses slightly different versions of Liquid to render dynamic content for the following features. These variations aren’t included in this reference. [![](https://shopify.dev/images/icons/32/liquidnotificationstemplate.png)![](https://shopify.dev/images/icons/32/liquidnotificationstemplate-dark.png)\ \ Notification templates\ \ Notification templates](https://help.shopify.com/en/manual/orders/notifications/email-variables) [Notification templates](https://help.shopify.com/en/manual/orders/notifications/email-variables) [![](https://shopify.dev/images/icons/32/flow.png)![](https://shopify.dev/images/icons/32/flow-dark.png)\ \ Shopify Flow\ \ Shopify Flow](https://help.shopify.com/en/manual/shopify-flow/reference/variables#liquid-variables) [Shopify Flow](https://help.shopify.com/en/manual/shopify-flow/reference/variables#liquid-variables) [![](https://shopify.dev/images/icons/32/liquidordertemplate.png)![](https://shopify.dev/images/icons/32/liquidordertemplate-dark.png)\ \ Order printer templates\ \ Order printer templates](https://help.shopify.com/en/manual/fulfillment/managing-orders/printing-orders/shopify-order-printer/liquid-variables-and-filters-reference) [Order printer templates](https://help.shopify.com/en/manual/fulfillment/managing-orders/printing-orders/shopify-order-printer/liquid-variables-and-filters-reference) [![](https://shopify.dev/images/icons/32/liquidpackingsliptemplate.png)![](https://shopify.dev/images/icons/32/liquidpackingsliptemplate-dark.png)\ \ Packing slip templates\ \ Packing slip templates](https://help.shopify.com/en/manual/orders/packing-slips-variable-list) [Packing slip templates](https://help.shopify.com/en/manual/orders/packing-slips-variable-list) * * * [Anchor to Liquid basics](https://shopify.dev/docs/api/liquid#liquid-basics) Liquid basics ---------------------------------------------------------------------------------------------- Liquid is used to dynamically output objects and their properties. You can further modify that output by creating logic with tags, or directly altering it with a filter. Objects and object properties are output using one of six basic data types. Liquid also includes basic logical and comparison operators for use with tags. [![](https://shopify.dev/images/icons/32/liquid.png)![](https://shopify.dev/images/icons/32/liquid-dark.png)\ \ Navigate toBasics\ \ Navigate to\ \ Basics](https://shopify.dev/docs/api/liquid/basics) [Navigate to - Basics](https://shopify.dev/docs/api/liquid/basics) * * * [Anchor to Defining logic with tags](https://shopify.dev/docs/api/liquid#defining-logic-with-tags) Defining logic with tags ------------------------------------------------------------------------------------------------------------------------------- Liquid tags are used to define logic that tells templates what to do. Tags are wrapped with curly brace percentage delimiters `{% %}`. The text within the delimiters is an instruction, not content to render. In the example to the right, the `if` tag defines the condition to be met. If `product.available` returns `true`, then the price is displayed. Otherwise, the “sold out” message is shown. ` {% %} ` To nest multiple tags inside one set of delimiters, use the [`liquid`](https://shopify.dev/docs/api/liquid/tags/liquid) tag. ### [Anchor to Tags with parameters](https://shopify.dev/docs/api/liquid#tags-with-parameters) Tags with parameters Some tags accept parameters: either required or optional. For example, the `for` tag takes an optional `limit` parameter to stop the loop at a specific index. * * * [Anchor to Modifying output with filters](https://shopify.dev/docs/api/liquid#modifying-output-with-filters) Modifying output with filters ---------------------------------------------------------------------------------------------------------------------------------------------- Liquid filters modify the output of variables and objects. To filter the output of a tag, use the pipe character `|`, followed by the filter. In this example, `product` is the object, `title` is its property, and `upcase` is the filter. ### [Anchor to Filters with parameters](https://shopify.dev/docs/api/liquid#filters-with-parameters) Filters with parameters Many filters accept parameters that adjust their output. Some parameters are required, others are optional. ### [Anchor to Using multiple filters](https://shopify.dev/docs/api/liquid#using-multiple-filters) Using multiple filters Multiple filters can be used on one output. They're applied from left to right. * * * [Anchor to Referencing objects](https://shopify.dev/docs/api/liquid#referencing-objects) Referencing objects ---------------------------------------------------------------------------------------------------------------- Liquid objects represent variables that you can use to build your theme. Object types include, but aren't limited to: * Store resources, such as a collection or product and its properties * Standard content that is used to power Shopify themes, such as `content_for_header` * Functional elements that can be used to build interactivity, such as `paginate` and `search` Objects might represent a single data point, or contain multiple properties. Some products might represent a related object, such as a product in a collection. ` {{ }} ` Double curly brace delimiters denote an output. ### [Anchor to Usage](https://shopify.dev/docs/api/liquid#usage) Usage To output an object, wrap it in curly brace delimiters `{{ }}`. To output an object's property, use dot notation. This example outputs the `product` object's `title` property. ### [Anchor to Object access](https://shopify.dev/docs/api/liquid#object-access) Object access Objects can be accessed in three ways: * **Globally**: Available in any Liquid file, excluding [checkout.liquid](https://shopify.dev/themes/architecture/layouts/checkout-liquid) and [Liquid asset files](https://shopify.dev/themes/architecture#assets) * **In templates**: Available in specific templates and their sections or blocks. For example, the [`product`](https://shopify.dev/docs/api/liquid/objects/product) object in a [product template](https://shopify.dev/themes/architecture/templates/product) * **Through parent objects**: Returned as properties of other objects. For example, [`article`](https://shopify.dev/docs/api/liquid/objects/article) objects through [`articles`](https://shopify.dev/docs/api/liquid/objects/articles) or [`blog`](https://shopify.dev/docs/api/liquid/objects/blog) Check each object's documentation to see how it can be accessed. ### [Anchor to Creating variables](https://shopify.dev/docs/api/liquid#creating-variables) Creating variables To create your own variables, use variable tags like [`assign`](https://shopify.dev/docs/api/liquid/tags/assign) or [`capture`](https://shopify.dev/docs/api/liquid/tags/capture) . Syntactically, Liquid treats variables the same as objects. * * * [Anchor to Resources & tools](https://shopify.dev/docs/api/liquid#resources-and-tools) Resources & tools ------------------------------------------------------------------------------------------------------------ [![](https://shopify.dev/images/icons/48/cheatsheet.png)![](https://shopify.dev/images/icons/48/cheatsheet-dark.png)\ \ Liquid Cheat Sheet\ \ A simple reference guide to the Liquid language.\ \ Liquid Cheat Sheet\ \ A simple reference guide to the Liquid language.](https://www.shopify.com/partners/shopify-cheat-sheet) [Liquid Cheat Sheet \ \ \ A simple reference guide to the Liquid language.](https://www.shopify.com/partners/shopify-cheat-sheet) [![](https://shopify.dev/images/icons/48/themecheck.png)![](https://shopify.dev/images/icons/48/themecheck-dark.png)\ \ Theme Check\ \ Command line-based linter for themes. Also comes as an official Visual Studio Code extension.\ \ Theme Check\ \ Command line-based linter for themes. Also comes as an official Visual Studio Code extension.](https://shopify.dev/themes/tools/theme-check) [Theme Check \ \ \ Command line-based linter for themes. Also comes as an official Visual Studio Code extension.](https://shopify.dev/themes/tools/theme-check) [![](https://shopify.dev/images/icons/48/cli.png)![](https://shopify.dev/images/icons/48/cli-dark.png)\ \ Shopify CLI for Themes\ \ A powerful command-line tool for building Shopify themes, and exploring Liquid code in a REPL interface.\ \ Shopify CLI for Themes\ \ A powerful command-line tool for building Shopify themes, and exploring Liquid code in a REPL interface.](https://shopify.dev/themes/tools/cli) [Shopify CLI for Themes \ \ \ A powerful command-line tool for building Shopify themes, and exploring Liquid code in a REPL interface.](https://shopify.dev/themes/tools/cli) [![](https://shopify.dev/images/icons/48/github.png)![](https://shopify.dev/images/icons/48/github-dark.png)\ \ Open source liquid\ \ Liquid is an open source project on GitHub.\ \ Open source liquid\ \ Liquid is an open source project on GitHub.](https://github.com/Shopify/liquid) [Open source liquid \ \ \ Liquid is an open source project on GitHub.](https://github.com/Shopify/liquid) * * * Was this page helpful? YesNo Assistant --- # Liquid tags: capture [Skip to main content](https://shopify.dev/docs/api/liquid/tags/capture#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window Creates a new variable with a string value. You can create complex strings with Liquid logic and variables. * * * Caution Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. **Caution:** Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. **Caution:** Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. * * * Syntax ------ 9 1 2 3 {% capture variable %} value {% endcapture %} variable The name of the variable being created. value The value you want to assign to the variable. 99 1 2 3 4 5 6 7 8 9 10 11 12 13 {%- assign up\_title \= product.title | upcase \-%} {%- assign down\_title \= product.title | downcase \-%} {%- assign show\_up\_title \= true \-%} {%- capture title \-%} {% if show\_up\_title \-%} Upcase title: {{ up\_title }} {%- else \-%} Downcase title: {{ down\_title }} {%- endif %} {%- endcapture %} {{ title }} ##### Code {%- assign up_title = product.title | upcase -%} {%- assign down_title = product.title | downcase -%} {%- assign show_up_title = true -%} {%- capture title -%} {% if show_up_title -%} Upcase title: {{ up_title }} {%- else -%} Downcase title: {{ down_title }} {%- endif %} {%- endcapture %} {{ title }} ##### Data { "product": { "title": "Health potion" } } Output ------ 9 1 Upcase title: HEALTH POTION ##### Output Upcase title: HEALTH POTION Was this page helpful? YesNo Assistant --- # Liquid tags: assign [Skip to main content](https://shopify.dev/docs/api/liquid/tags/assign#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window Creates a new variable. You can create variables of any [basic type](https://shopify.dev/docs/api/liquid/basics#types) , [object](https://shopify.dev/docs/api/liquid/objects) , or object property. * * * Caution Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. **Caution:** Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. **Caution:** Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. * * * Syntax ------ 9 1 {% assign variable\_name \= value %} variable\_name The name of the variable being created. value The value you want to assign to the variable. 9 1 2 3 {%- assign product\_title \= product.title | upcase \-%} {{ product\_title }} ##### Code {%- assign product_title = product.title | upcase -%} {{ product_title }} ##### Data { "product": { "title": "Health potion" } } Output ------ 9 1 HEALTH POTION ##### Output HEALTH POTION Was this page helpful? YesNo Assistant --- # Liquid tags: liquid [Skip to main content](https://shopify.dev/docs/api/liquid/tags/liquid#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window Allows you to have a block of Liquid without delimeters on each tag. Because the tags don't have delimeters, each tag needs to be on its own line. * * * Tip Use the [`echo` tag](https://shopify.dev/docs/api/liquid/tags/echo) to output an expression inside `liquid` tags. **Tip:** Use the [`echo` tag](https://shopify.dev/docs/api/liquid/tags/echo) to output an expression inside `liquid` tags. **Tip:** Use the echo tag to output an expression inside liquid tags. * * * Syntax ------ 9 1 2 3 {% liquid expression %} expression The expression to be rendered inside the `liquid` tag. 99 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 {% liquid \# Show a message that's customized to the product type assign product\_type \= product.type | downcase assign message \= '' case product\_type when 'health' assign message \= 'This is a health potion!' when 'love' assign message \= 'This is a love potion!' else assign message \= 'This is a potion!' endcase echo message %} ##### Code {% liquid # Show a message that's customized to the product type assign product_type = product.type | downcase assign message = '' case product_type when 'health' assign message = 'This is a health potion!' when 'love' assign message = 'This is a love potion!' else assign message = 'This is a potion!' endcase echo message %} ##### Data { "product": { "type": null } } Output ------ 9 1 This is a health potion! ##### Output This is a health potion! Was this page helpful? YesNo Assistant --- # Liquid basics [Skip to main content](https://shopify.dev/docs/api/liquid/basics#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window Basics ====== The following are basic concepts that you need to effectively interact with Liquid tags, filters, and objects. Ask assistant [Anchor to Object handles](https://shopify.dev/docs/api/liquid/basics#object-handles) Object handles -------------------------------------------------------------------------------------------------------- Objects that represent store resources, such as products, collections, articles, and blogs, have handles for identifying an individual resource. The handle is used to build the URL for the resource, or to return properties for the resource. Other objects like `linklists`, `links`, and `settings` also have handles. ### [Anchor to Creating and modifying handles](https://shopify.dev/docs/api/liquid/basics#creating-and-modifying-handles) Creating and modifying handles Handles are automatically generated based on the resource title. They follow a set of rules: * Handles are always lowercase * Whitespace and special characters are replaced with a hyphen `-`. * If there are multiple consecutive whitespace or special characters, then they're replaced with a single hyphen. * Whitespace or special characters at the beginning are removed. Handles need to be unique, so if a duplicate title is used, then the handle is auto-incremented by one. For example, if you had two products called `Potion`, then their handles would be `potion` and `potion-1`. After a resource has been created, changing the resource title doesn't update the handle. You can modify a resource's handle within the Shopify admin. This can be done either in the Handle or the Edit website SEO sections, depending on the resource. If you reference resources by their handle, then be sure to update those references when modifying handles. * * * Note Individual links from `linklists` have handles based on their titles. These handles can't be modified directly. Individual settings, from `settings_schema.json`, sections, or blocks, get their handle from their `id` property. **Note:** Individual links from `linklists` have handles based on their titles. These handles can't be modified directly. Individual settings, from `settings_schema.json`, sections, or blocks, get their handle from their `id` property. * * * ### [Anchor to Referencing handles](https://shopify.dev/docs/api/liquid/basics#referencing-handles) Referencing handles All objects that have a handle have a `handle` property. For example, you can output a product's handle with `product.handle`. You can reference an object, from within its parent object, by its handle in two ways: * Square bracket notation `[ ]`: Accepts a handle wrapped in quotes `'`, a Liquid variable, or an object reference. * Dot notation `.`: Accepts a handle without quotes. * * * Note Referencing an object by its handle is similar to [referencing array elements by their index](https://shopify.dev/docs/api/liquid/basics#array) . **Note:** Referencing an object by its handle is similar to [referencing array elements by their index](https://shopify.dev/docs/api/liquid/basics#array) . * * * * * * [Anchor to Logical and comparison operators](https://shopify.dev/docs/api/liquid/basics#logical-and-comparison-operators) Logical and comparison operators -------------------------------------------------------------------------------------------------------------------------------------------------------------- Liquid supports basic logical and comparison operators for use with conditional tags: [`case`](https://shopify.dev/docs/api/liquid/tags/case) , [`else`](https://shopify.dev/docs/api/liquid/tags/conditional-else) , [`if`](https://shopify.dev/docs/api/liquid/tags/if) and [`unless`](https://shopify.dev/docs/api/liquid/tags/unless) . #### [Anchor to contains](https://shopify.dev/docs/api/liquid/basics#contains) contains You can use `contains` to check for the presence of a string within an array, or another string. You can’t use `contains` to check for an object in an array of objects. ### [Anchor to Order of operations](https://shopify.dev/docs/api/liquid/basics#order-of-operations) Order of operations When using more than one operator in a tag, the operators are evaluated from right to left, and you can’t change this order. * * * Caution Parentheses `()` aren’t valid characters within Liquid tags. If you try to include them to group operators, then your tag won’t be rendered. **Caution:** Parentheses `()` aren’t valid characters within Liquid tags. If you try to include them to group operators, then your tag won’t be rendered. * * * * * * [Anchor to Types](https://shopify.dev/docs/api/liquid/basics#types) Types ----------------------------------------------------------------------------- Liquid output can be one of six data types. ### [Anchor to \[object Object\]](https://shopify.dev/docs/api/liquid/basics#string) string Any series of characters, wrapped in single or double quotes. * * * Info You can check whether a string is empty with the `blank` object. **Info:** You can check whether a string is empty with the `blank` object. * * * ### [Anchor to \[object Object\]](https://shopify.dev/docs/api/liquid/basics#number) number Numeric values, including floats and integers. ### [Anchor to \[object Object\]](https://shopify.dev/docs/api/liquid/basics#boolean) boolean A binary value, either `true` or `false`. ### [Anchor to \[object Object\]](https://shopify.dev/docs/api/liquid/basics#nil) nil An undefined value. Tags or outputs that return `nil` don't print anything to the page. They are also treated as `false`. * * * Note A string with the characters “nil” is not treated the same as `nil`. **Note:** A string with the characters “nil” is not treated the same as `nil`. * * * ### [Anchor to \[object Object\]](https://shopify.dev/docs/api/liquid/basics#array) array A list of variables of any type. To access all of the items in an array, you can loop through each item in the array using a [`for`](https://shopify.dev/docs/api/liquid/tags/for) or [`tablerow`](https://shopify.dev/docs/api/liquid/tags/tablerow) tag. You can use square bracket `[ ]` notation to access a specific item in an array. Array indexing starts at zero. You can’t initialize arrays using only Liquid. You can, however, use the split filter to break a single string into an array of substrings. ### [Anchor to \[object Object\]](https://shopify.dev/docs/api/liquid/basics#empty) empty An `empty` object is returned if you try to access an object that is defined, but has no value. For example a page or product that’s been deleted, or a setting with no value. You can compare an object with `empty` to check whether an object exists before you access any of its attributes. * * * [Anchor to Truthy and falsy](https://shopify.dev/docs/api/liquid/basics#truthy-and-falsy) Truthy and falsy -------------------------------------------------------------------------------------------------------------- All data types must return either `true` or `false`. Those which return `true` by default are called truthy. Those that return `false` by default are called falsy. ### [Anchor to Example](https://shopify.dev/docs/api/liquid/basics#example) Example Because `nil` and `false` are the only falsy values, you need to be careful how you check values in Liquid. A value might not be in the format you expect, but still be truthy. For example, empty strings are truthy, so you need to check whether they’re empty with `blank`. `EmptyDrop` objects are also truthy, so you need to check whether the object you’re referencing is `empty`. * * * [Anchor to Whitespace control](https://shopify.dev/docs/api/liquid/basics#whitespace-control) Whitespace control -------------------------------------------------------------------------------------------------------------------- Even if it doesn't output text, any line of Liquid outputs a line in your rendered content. By including hyphens in your Liquid tag, you can strip any whitespace that your Liquid generates when rendered. If you want to remove whitespace on only one side of the Liquid tag, then you can include the hyphen on either the opening or closing tag. * * * Was this page helpful? YesNo Assistant --- # Liquid objects: product [Skip to main content](https://shopify.dev/docs/api/liquid/objects/product#main-content) A [product](https://help.shopify.com/manual/products) in the store. Properties ---------- [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-available) available**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. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-category) category**category** [taxonomy\_category](https://shopify.dev/docs/api/liquid/objects/taxonomy_category) The taxonomy category for the product [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-collections) collections**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. **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. **Note:** Collections that aren't available on the Online Store sales channel aren't included. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-compare_at_price) compare\_at\_price**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. **Tip:** Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. **Tip:** Use money filters to output a formatted price. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-compare_at_price_max) compare\_at\_price\_max**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. **Tip:** Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. **Tip:** Use money filters to output a formatted price. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-compare_at_price_min) compare\_at\_price\_min**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. **Tip:** Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. **Tip:** Use money filters to output a formatted price. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-compare_at_price_varies) compare\_at\_price\_varies**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. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-content) content**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) . **Note:** This is the same value as [`product.description`](https://shopify.dev/docs/api/liquid/objects/product#product-description) . **Note:** This is the same value as product.description. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-created_at) created\_at**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. **Tip:** Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the date filter to format the timestamp. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-description) description**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) . **Note:** This is the same value as [`product.content`](https://shopify.dev/docs/api/liquid/objects/product#product-content) . **Note:** This is the same value as product.content. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-featured_image) featured\_image**featured\_image** [image](https://shopify.dev/docs/api/liquid/objects/image) The first (featured) image attached to the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-featured_media) featured\_media**featured\_media** [media](https://shopify.dev/docs/api/liquid/objects/media) The first (featured) media attached to the product. Note In search results or a filtered collection, the [media](https://shopify.dev/docs/api/liquid/objects/media) of the most relevant variant is returned. Relevancy is based on search terms and applied filters. **Note:** In search results or a filtered collection, the [media](https://shopify.dev/docs/api/liquid/objects/media) of the most relevant variant is returned. Relevancy is based on search terms and applied filters. **Note:** In search results or a filtered collection, the media of the most relevant variant is returned. Relevancy is based on search terms and applied filters. 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) . **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) . **Tip:** You can use media filters to output media URLs and displays. To learn about how to include media in your theme, refer to Support product media. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-first_available_variant) first\_available\_variant**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`. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-gift_card?) gift\_card?**gift\_card?** [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) Returns `true` if the product is a gift card. Returns `false` if not. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-handle) handle**handle** [string](https://shopify.dev/docs/api/liquid/basics#string) The [handle](https://shopify.dev/docs/api/liquid/basics#handles) of the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-has_only_default_variant) has\_only\_default\_variant**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. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-id) id**id** [number](https://shopify.dev/docs/api/liquid/basics#number) The ID of the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-images) images**images** array of [image](https://shopify.dev/docs/api/liquid/objects/image) The images attached to the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-media) media**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) . **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) . **Tip:** You can use media filters to output media URLs and displays. To learn about how to include media in your theme, refer to Support product media. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-metafields) metafields**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) . **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) . **Tip:** To learn about how to create metafields, refer to Create and manage metafields or visit the Shopify Help Center. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-options) options**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) Example Output 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. 9 1 2 3 4 5 {% 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 ------ 9 1 2 \- Size \- Strength ##### Output - Size - Strength [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-options_by_name) options\_by\_name**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) Example Output the values for a specific option When accessing a specific option, the name is case-insensitive. 9 1 2 3 4 5 6 7 8 Strength {%- for value in product.options\_by\_name\['strength'\].values %} {{ value }} {%- endfor %} ##### Code ##### Data { "product": { "options_by_name": {} } } Output ------ 9 1 2 3 4 5 6 7 8 Strength Low Medium High ##### Output [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-options_with_values) options\_with\_values**options\_with\_values** array of [product\_option](https://shopify.dev/docs/api/liquid/objects/product_option) The options on the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-price) price**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) . **Note:** This is the same value as [`product.price_min`](https://shopify.dev/docs/api/liquid/objects/product#product-price_min) . **Note:** This is the same value as 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. **Tip:** Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. **Tip:** Use money filters to output a formatted price. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-price_max) price\_max**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. **Tip:** Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. **Tip:** Use money filters to output a formatted price. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-price_min) price\_min**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) . **Note:** This is the same value as [`product.price`](https://shopify.dev/docs/api/liquid/objects/product#product-price) . **Note:** This is the same value as 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. **Tip:** Use [money filters](https://shopify.dev/docs/api/liquid/filters/money-filters) to output a formatted price. **Tip:** Use money filters to output a formatted price. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-price_varies) price\_varies**price\_varies** [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) Returns `true` if the product's variant prices vary. Returns `false` if not. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-published_at) published\_at**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. **Tip:** Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the date filter to format the timestamp. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-quantity_price_breaks_configured?) quantity\_price\_breaks\_configured?**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. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-requires_selling_plan) requires\_selling\_plan**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`. **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`. **Note:** A variant requires a selling plan if variant.requires\_selling\_plan is true. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-selected_or_first_available_selling_plan_allocation) selected\_or\_first\_available\_selling\_plan\_allocation**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. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-selected_or_first_available_variant) selected\_or\_first\_available\_variant**selected\_or\_first\_available\_variant** [variant](https://shopify.dev/docs/api/liquid/objects/variant) The currently selected or first available variant of the product. If a variant is selected, it will be returned, regardless of its availability. Otherwise, the first available variant is returned. If no available variant exists, the first variant is returned. A selected variant is determined by the following criteria: * On product pages, it is based on the variant ID set in the `variant` URL parameter. * In search results and filtered collections, it is the most relevant variant based on search terms and applied filters. 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`. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-selected_selling_plan) selected\_selling\_plan**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. **Note:** The selected selling plan is determined by the `selling_plan` URL parameter. **Note:** The selected selling plan is determined by the selling\_plan URL parameter. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-selected_selling_plan_allocation) selected\_selling\_plan\_allocation**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. **Note:** The selected variant is determined by the `variant` URL parameter, and the selected selling plan is determined by the `selling_plan` URL parameter. **Note:** The selected variant is determined by the variant URL parameter, and the selected selling plan is determined by the selling\_plan URL parameter. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-selected_variant) selected\_variant**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 On product pages, it is based on the variant ID set in the `variant` URL parameter. In search results and filtered collections, it is the most relevant variant based on search terms and applied filters. **Note:** On product pages, it is based on the variant ID set in the `variant` URL parameter. In search results and filtered collections, it is the most relevant variant based on search terms and applied filters. **Note:** On product pages, it is based on the variant ID set in the variant URL parameter. In search results and filtered collections, it is the most relevant variant based on search terms and applied filters. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-selling_plan_groups) selling\_plan\_groups**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. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-tags) tags**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. **Note:** The tags are returned in alphabetical order. **Note:** The tags are returned in alphabetical order. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-template_suffix) template\_suffix**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. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-title) title**title** [string](https://shopify.dev/docs/api/liquid/basics#string) The title of the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-type) type**type** [string](https://shopify.dev/docs/api/liquid/basics#string) The type of the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-url) url**url** [string](https://shopify.dev/docs/api/liquid/basics#string) The relative URL of the product. If a product is rendered in search results or a filtered collection, then the URL contains the `variant` parameter of the most relevant variant. 9 1 /products/gorgeous-wooden-computer?variant=1234567890 /products/gorgeous-wooden-computer?variant=1234567890 If a product is rendered as a [product recommendation](https://shopify.dev/docs/themes/product-merchandising/recommendations) , then the URL contains tracking parameters: 9 1 /products/gorgeous-wooden-computer?pr\_choice=default&pr\_prod\_strat=description&pr\_rec\_pid=13&pr\_ref\_pid=17&pr\_seq=alternating /products/gorgeous-wooden-computer?pr_choice=default&pr_prod_strat=description&pr_rec_pid=13&pr_ref_pid=17&pr_seq=alternating [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-variants) variants**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. **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. **Note:** Returns a maximum of 250 variants when unpaginated. Tip: Use the paginate tag to choose how many variants to show per page, up to a limit of 50. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-variants_count) variants\_count**variants\_count** [number](https://shopify.dev/docs/api/liquid/basics#number) The total number of variants for the product. [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#product-vendor) vendor**vendor** [string](https://shopify.dev/docs/api/liquid/basics#string) The vendor of the product. 99 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 { "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" } [Anchor to](https://shopify.dev/docs/api/liquid/objects/product#template-using) Templates using product ----------------------- [![](https://shopify.dev/images/icons/32/themes.png)![](https://shopify.dev/images/icons/32/themes-dark.png)\ \ Theme architectureproduct template\ \ Theme architecture\ \ product template](https://shopify.dev/themes/architecture/templates/product) Was this section helpful? YesNo --- # Liquid objects: articles [Skip to main content](https://shopify.dev/docs/api/liquid/objects/articles#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window All of the articles across the blogs in the store. ### Directly accessible in * Global You can use `articles` to access an article by its [handle](https://shopify.dev/docs/api/liquid/basics#handles) . 9 1 2 {% assign article \= articles\['potion-notions/new-potions-for-spring'\] %} {{ article.title | link\_to: article.url }} ##### Code {% assign article = articles['potion-notions/new-potions-for-spring'] %} {{ article.title | link_to: article.url }} Output ------ 9 1 New potions for spring ##### Output New potions for spring Was this section helpful? YesNo Assistant --- # Liquid objects: article [Skip to main content](https://shopify.dev/docs/api/liquid/objects/article#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window An article, or [blog post](https://help.shopify.com/manual/online-store/blogs/writing-blogs) , in a blog. Properties ---------- [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-author) author**author** [string](https://shopify.dev/docs/api/liquid/basics#string) The full name of the author of the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-comment_post_url) comment\_post\_url**comment\_post\_url** [string](https://shopify.dev/docs/api/liquid/basics#string) The relative URL where POST requests are sent when creating new comments. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-comments) comments**comments** array of [comment](https://shopify.dev/docs/api/liquid/objects/comment) The published comments for the article. Returns an empty array if comments are disabled. Tip Use the [paginate](https://shopify.dev/docs/api/liquid/tags/paginate) tag to choose how many comments to show at once, up to a limit of 50. **Tip:** Use the [paginate](https://shopify.dev/docs/api/liquid/tags/paginate) tag to choose how many comments to show at once, up to a limit of 50. **Tip:** Use the paginate tag to choose how many comments to show at once, up to a limit of 50. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-comments_count) comments\_count**comments\_count** [number](https://shopify.dev/docs/api/liquid/basics#number) The number of published comments for the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-comments_enabled?) comments\_enabled?**comments\_enabled?** [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) Returns `true` if comments are enabled. Returns `false` if not. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-content) content**content** [string](https://shopify.dev/docs/api/liquid/basics#string) The content of the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-created_at) created\_at**created\_at** [string](https://shopify.dev/docs/api/liquid/basics#string) A timestamp for when the article was created. Tip Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the date filter to format the timestamp. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-excerpt) excerpt**excerpt** [string](https://shopify.dev/docs/api/liquid/basics#string) The excerpt of the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-excerpt_or_content) excerpt\_or\_content**excerpt\_or\_content** [string](https://shopify.dev/docs/api/liquid/basics#string) Returns the article [excerpt](https://shopify.dev/docs/api/liquid/objects/article#article-excerpt) if it exists. Returns the article [content](https://shopify.dev/docs/api/liquid/objects/article#article-content) if no excerpt exists. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-handle) handle**handle** [string](https://shopify.dev/docs/api/liquid/basics#string) The [handle](https://shopify.dev/docs/api/liquid/basics#handles) of the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-id) id**id** [string](https://shopify.dev/docs/api/liquid/basics#string) The ID of the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-image) image**image** [image](https://shopify.dev/docs/api/liquid/objects/image) The featured image for the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-metafields) metafields**metafields** The [metafields](https://shopify.dev/docs/api/liquid/objects/metafield) applied to the article. 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) . **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) . **Tip:** To learn about how to create metafields, refer to Create and manage metafields or visit the Shopify Help Center. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-moderated?) moderated?**moderated?** [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) Returns `true` if the blog that the article belongs to is set to [moderate comments](https://help.shopify.com/manual/online-store/blogs/managing-comments) . Returns `false` if not. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-published_at) published\_at**published\_at** [string](https://shopify.dev/docs/api/liquid/basics#string) A timestamp for when the article was published. Tip Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the date filter to format the timestamp. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-tags) tags**tags** array of [string](https://shopify.dev/docs/api/liquid/basics#string) The tags applied to the article. ![](https://shopify.dev/images/icons/32/lightbulbscroll.png)![](https://shopify.dev/images/icons/32/lightbulbscroll-dark.png) Example Show the total tag count When looping through `article.tags`, you can print how many times a tag is used with `tag.total_count`. This number shows visitors how many blog posts have been tagged with a particular tag. ##### Code {% for tag in article.tags -%} {{ tag }} ({{ tag.total_count }}) {%- endfor %} ##### Data { "article": { "tags": [\ "clear potions",\ "potion troubleshooting",\ "tips"\ ] } } Output ------ ##### Output clear potions (1)potion troubleshooting (2)tips (2) [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-template_suffix) template\_suffix**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) assigned to the article. The name doesn't include the `article.` prefix, or the file extension (`.json` or `.liquid`). If a custom template isn't assigned to the article, then `nil` is returned. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-title) title**title** [string](https://shopify.dev/docs/api/liquid/basics#string) The title of the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-updated_at) updated\_at**updated\_at** [string](https://shopify.dev/docs/api/liquid/basics#string) A timestamp for when the article was updated. Tip Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the [`date` filter](https://shopify.dev/docs/api/liquid/filters/date) to format the timestamp. **Tip:** Use the date filter to format the timestamp. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-url) url**url** [string](https://shopify.dev/docs/api/liquid/basics#string) The relative URL of the article. [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#article-user) user**user** [user](https://shopify.dev/docs/api/liquid/objects/user) The user associated with the author of the article. 99 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 { "author": "Polina Waters", "comment\_post\_url": "/blogs/potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion/comments", "comments": \[\], "comments\_count": 1, "comments\_enabled?": true, "content": "

We've all had this problem before: we peek into the potions vault to determine which potions we are running low on, and the invisibility potion bottle looks completely empty.

\\n

...

\\n

 

", "created\_at": "2022-04-14 16:56:02 -0400", "excerpt": "And where to buy more!", "excerpt\_or\_content": "And where to buy more!", "handle": "potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion", "id": 556510085185, "image": {}, "metafields": {}, "moderated?": true, "published\_at": "2022-04-14 16:56:02 -0400", "tags": \[\], "template\_suffix": "", "title": "How to tell if you're out of invisibility potion", "updated\_at": "2022-06-04 19:27:33 -0400", "url": {}, "user": {} } ##### Example { "author": "Polina Waters", "comment_post_url": "/blogs/potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion/comments", "comments": [], "comments_count": 1, "comments_enabled?": true, "content": "

We've all had this problem before: we peek into the potions vault to determine which potions we are running low on, and the invisibility potion bottle looks completely empty.

\n

...

\n

 

", "created_at": "2022-04-14 16:56:02 -0400", "excerpt": "And where to buy more!", "excerpt_or_content": "And where to buy more!", "handle": "potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion", "id": 556510085185, "image": {}, "metafields": {}, "moderated?": true, "published_at": "2022-04-14 16:56:02 -0400", "tags": [], "template_suffix": "", "title": "How to tell if you're out of invisibility potion", "updated_at": "2022-06-04 19:27:33 -0400", "url": {}, "user": {} } [Anchor to](https://shopify.dev/docs/api/liquid/objects/article#template-using) Templates using article ----------------------- [![](https://shopify.dev/images/icons/32/themes.png)![](https://shopify.dev/images/icons/32/themes-dark.png)\ \ Theme architecturearticle template\ \ Theme architecture\ \ article template](https://shopify.dev/themes/architecture/templates/article) Was this section helpful? YesNo Assistant --- # Liquid objects: blog [Skip to main content](https://shopify.dev/docs/api/liquid/objects/blog#main-content) Shopify uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our [privacy policy](https://www.shopify.com/legal/privacy) and our [cookie policy](https://www.shopify.com/legal/cookies) . OK Opens in a new window Information about a specific [blog](https://help.shopify.com/manual/online-store/blogs/adding-a-blog) in the store. Properties ---------- [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-all_tags) all\_tags**all\_tags** array of [string](https://shopify.dev/docs/api/liquid/basics#string) All of the tags on the articles in the blog. This includes tags of articles that aren't in the current pagination view. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-articles) articles**articles** array of [article](https://shopify.dev/docs/api/liquid/objects/article) The articles in the blog. Tip Use the [paginate](https://shopify.dev/docs/api/liquid/tags/paginate) tag to choose how many articles to show per page, up to a limit of 50. **Tip:** Use the [paginate](https://shopify.dev/docs/api/liquid/tags/paginate) tag to choose how many articles to show per page, up to a limit of 50. **Tip:** Use the paginate tag to choose how many articles to show per page, up to a limit of 50. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-articles_count) articles\_count**articles\_count** [number](https://shopify.dev/docs/api/liquid/basics#number) The total number of articles in the blog. This total doesn't include hidden articles. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-comments_enabled?) comments\_enabled?**comments\_enabled?** [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) Returns `true` if comments are enabled for the blog. Returns `false` if not. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-handle) handle**handle** [string](https://shopify.dev/docs/api/liquid/basics#string) The [handle](https://shopify.dev/docs/api/liquid/basics#handles) of the blog. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-id) id**id** [number](https://shopify.dev/docs/api/liquid/basics#number) The ID of the blog. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-metafields) metafields**metafields** array of [metafield](https://shopify.dev/docs/api/liquid/objects/metafield) The [metafields](https://shopify.dev/docs/api/liquid/objects/metafield) applied to the blog. 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) . **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) . **Tip:** To learn about how to create metafields, refer to Create and manage metafields or visit the Shopify Help Center. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-moderated?) moderated?**moderated?** [boolean](https://shopify.dev/docs/api/liquid/basics#boolean) Returns `true` if the blog is set to [moderate comments](https://help.shopify.com/manual/online-store/blogs/managing-comments) . Returns `false` if not. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-next_article) next\_article**next\_article** [article](https://shopify.dev/docs/api/liquid/objects/article) The next (older) article in the blog. Returns `nil` if there is no next article. This property can be used on the [article page](https://shopify.dev/themes/architecture/templates/article) to output `next` links. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-previous_article) previous\_article**previous\_article** [article](https://shopify.dev/docs/api/liquid/objects/article) The previous (newer) article in the blog. Returns `nil` if there is no previous article. This property can be used on the [article page](https://shopify.dev/themes/architecture/templates/article) to output `previous` links. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-tags) tags**tags** array of [string](https://shopify.dev/docs/api/liquid/basics#string) A list of all of the tags on all of the articles in the blog. Unlike [`blog.all_tags`](https://shopify.dev/docs/api/liquid/objects/blog#blog-all_tags) , this property only returns tags of articles that are in the filtered view. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-template_suffix) template\_suffix**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) assigned to the blog. The name doesn't include the `blog.` prefix, or the file extension (`.json` or `.liquid`). If a custom template isn't assigned to the blog, then `nil` is returned. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-title) title**title** [string](https://shopify.dev/docs/api/liquid/basics#string) The title of the blog. [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#blog-url) url**url** [string](https://shopify.dev/docs/api/liquid/basics#string) The relative URL of the blog. 99 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 { "all\_tags": \[\], "articles": \[\], "articles\_count": 3, "comments\_enabled?": true, "handle": "potion-notions", "id": 78580613185, "metafields": {}, "moderated?": true, "next\_article": {}, "previous\_article": {}, "tags": \[\], "template\_suffix": "", "title": "Potion Notions", "url": "/blogs/potion-notions" } ##### Example { "all_tags": [], "articles": [], "articles_count": 3, "comments_enabled?": true, "handle": "potion-notions", "id": 78580613185, "metafields": {}, "moderated?": true, "next_article": {}, "previous_article": {}, "tags": [], "template_suffix": "", "title": "Potion Notions", "url": "/blogs/potion-notions" } [Anchor to](https://shopify.dev/docs/api/liquid/objects/blog#template-using) Templates using blog -------------------- [![](https://shopify.dev/images/icons/32/themes.png)![](https://shopify.dev/images/icons/32/themes-dark.png)\ \ Theme architectureblog template\ \ Theme architecture\ \ blog template](https://shopify.dev/themes/architecture/templates/blog) [![](https://shopify.dev/images/icons/32/themes.png)![](https://shopify.dev/images/icons/32/themes-dark.png)\ \ Theme architecturearticle template\ \ Theme architecture\ \ article template](https://shopify.dev/themes/architecture/templates/article) Was this section helpful? YesNo Assistant --- # Liquid tags: case [Skip to main content](https://shopify.dev/docs/api/liquid/tags/case#main-content) Renders a specific expression depending on the value of a specific variable. Syntax ------ 9 1 2 3 4 5 6 7 8 {% case variable %} {% when first\_value %} first\_expression {% when second\_value %} second\_expression {% else %} third\_expression {% endcase %} variable The name of the variable you want to base your case statement on. first\_value A specific value to check for. second\_value A specific value to check for. first\_expression An expression to be rendered when the variable's value matches `first_value`. second\_expression An expression to be rendered when the variable's value matches `second_value`. third\_expression An expression to be rendered when the variable's value has no match. 9 1 2 3 4 5 6 7 8 {% case product.type %} {% when 'Health' %} This is a health potion. {% when 'Love' %} This is a love potion. {% else %} This is a potion. {% endcase %} ##### Code {% case product.type %} {% when 'Health' %} This is a health potion. {% when 'Love' %} This is a love potion. {% else %} This is a potion. {% endcase %} ##### Data { "product": { "type": null } } Output ------ 9 1 This is a health potion. ##### Output This is a health potion. [Anchor to Multiple values](https://shopify.dev/docs/api/liquid/tags/case#case-multiple-values) ### Multiple values Syntax ------ 9 1 2 3 4 5 6 7 8 {% case variable %} {% when first\_value or second\_value or third\_value %} first\_expression {% when fourth\_value, fifth\_value, sixth\_value %} second\_expression {% else %} third\_expression {% endcase %} A `when` tag can accept multiple values. When multiple values are provided, the expression is returned when the variable matches any of the values inside of the tag. Provide the values as a comma-separated list, or separate them using an `or` operator. 9 1 2 3 4 5 6 7 8 {% case product.type %} {% when 'Love' or 'Luck' %} This is a love or luck potion. {% when 'Strength','Health' %} This is a strength or health potion. {% else %} This is a potion. {% endcase %} ##### Code {% case product.type %} {% when 'Love' or 'Luck' %} This is a love or luck potion. {% when 'Strength','Health' %} This is a strength or health potion. {% else %} This is a potion. {% endcase %} ##### Data { "product": { "type": null } } Output ------ 9 1 This is a strength or health potion. ##### Output This is a strength or health potion. Was this page helpful? YesNo --- # Liquid objects: additional_checkout_buttons [Skip to main content](https://shopify.dev/docs/api/liquid/objects/additional_checkout_buttons#main-content) Returns `true` if a store has any payment providers with offsite checkouts, such as PayPal Express Checkout. Use `additional_checkout_buttons` to check whether these payment providers exist, and [`content_for_additional_checkout_buttons`](https://shopify.dev/docs/api/liquid/objects/content_for_additional_checkout_buttons) to show the associated checkout buttons. To learn more about how to use these objects, refer to [Accelerated checkout](https://shopify.dev/themes/pricing-payments/accelerated-checkout) . 9 1 2 3 {% if additional\_checkout\_buttons %} {{ content\_for\_additional\_checkout\_buttons }} {% endif %} {% if additional_checkout_buttons %} {{ content_for_additional_checkout_buttons }} {% endif %} ### Directly accessible in * Global Was this section helpful? YesNo --- # Liquid objects: taxonomy_category [Skip to main content](https://shopify.dev/docs/api/liquid/objects/taxonomy_category#main-content) The taxonomy category for a product Properties ---------- [Anchor to](https://shopify.dev/docs/api/liquid/objects/taxonomy_category#taxonomy_category-ancestors) ancestors**ancestors** array of [taxonomy\_category](https://shopify.dev/docs/api/liquid/objects/taxonomy_category) All parent nodes of the current taxonomy category. [Anchor to](https://shopify.dev/docs/api/liquid/objects/taxonomy_category#taxonomy_category-gid) gid**gid** [string](https://shopify.dev/docs/api/liquid/basics#string) The public node ID for the category, formatted as a Shopify GID. [Anchor to](https://shopify.dev/docs/api/liquid/objects/taxonomy_category#taxonomy_category-id) id**id** [string](https://shopify.dev/docs/api/liquid/basics#string) The public node ID for the category [Anchor to](https://shopify.dev/docs/api/liquid/objects/taxonomy_category#taxonomy_category-name) name**name** [string](https://shopify.dev/docs/api/liquid/basics#string) The localized category name 9 1 2 3 4 5 6 { "ancestors": \[\], "gid": "gid://shopify/TaxonomyCategory/hb-1-9-6", "id": "hb-1-9-6", "name": "Vitamins & Supplements" } ##### Example { "ancestors": [], "gid": "gid://shopify/TaxonomyCategory/hb-1-9-6", "id": "hb-1-9-6", "name": "Vitamins & Supplements" } Was this section helpful? YesNo --- # Liquid tags: comment [Skip to main content](https://shopify.dev/docs/api/liquid/tags/comment#main-content) Prevents an expression from being rendered or output. Any text inside `comment` tags won't be output, and any Liquid code will be parsed, but not executed. Syntax ------ 9 1 2 3 {% comment %} content {% endcomment %} content The content of the comment. [Anchor to Inline comments](https://shopify.dev/docs/api/liquid/tags/comment#comment-inline-comments) ### Inline comments Syntax ------ 9 1 {% \# content %} Inline comments prevent an expression inside of a tag `{% %}` from being rendered or output. You can use inline comment tags to annotate your code, or to temporarily prevent logic in your code from executing. You can create multi-line inline comments. However, each line in the tag must begin with a `#`, or a syntax error will occur. 99 1 2 3 4 5 6 7 8 9 10 11 12 {% \# this is a comment %} {% \# for i in (1..3) -%} {{ i }} {% \# endfor %} {% ############################### \# This is a comment \# across multiple lines ############################### %} ##### Code {% # this is a comment %} {% # for i in (1..3) -%} {{ i }} {% # endfor %} {% ############################### # This is a comment # across multiple lines ############################### %} Output ------ 9 1 ##### Output [Anchor to Inline comments inside \`liquid\` tags](https://shopify.dev/docs/api/liquid/tags/comment#comment-inline-comments-inside-liquid-tags) ### Inline comments inside `liquid` tags You can use inline comment tags inside [`liquid` tags](https://shopify.dev/docs/api/liquid/tags/liquid) . The tag must be used for each line that you want to comment. 9 1 2 3 4 5 {% liquid \# this is a comment assign topic \= 'Learning about comments!' echo topic %} ##### Code {% liquid # this is a comment assign topic = 'Learning about comments!' echo topic %} Output ------ 9 1 Learning about comments! ##### Output Learning about comments! Was this page helpful? YesNo --- # Liquid tags: decrement [Skip to main content](https://shopify.dev/docs/api/liquid/tags/decrement#main-content) Creates a new variable, with a default value of -1, that's decreased by 1 with each subsequent call. * * * Caution Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. **Caution:** Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. **Caution:** Predefined Liquid objects can be overridden by variables with the same name. To make sure that you can access all Liquid objects, make sure that your variable name doesn't match a predefined object's name. * * * Variables that are declared with `decrement` are unique to the [layout](https://shopify.dev/themes/architecture/layouts) , [template](https://shopify.dev/themes/architecture/templates) , or [section](https://shopify.dev/themes/architecture/sections) file that they're created in. However, the variable is shared across [snippets](https://shopify.dev/themes/architecture/snippets) included in the file. Similarly, variables that are created with `decrement` are independent from those created with [`assign`](https://shopify.dev/docs/api/liquid/tags/assign) and [`capture`](https://shopify.dev/docs/api/liquid/tags/capture) . However, `decrement` and [`increment`](https://shopify.dev/docs/api/liquid/tags/increment) share variables. Syntax ------ 9 1 {% decrement variable\_name %} variable\_name The name of the variable being decremented. 9 1 2 3 {% decrement variable %} {% decrement variable %} {% decrement variable %} ##### Code {% decrement variable %} {% decrement variable %} {% decrement variable %} Output ------ 9 1 2 3 \-1 \-2 \-3 ##### Output -1 -2 -3 Was this page helpful? YesNo --- # Liquid tags: doc [Skip to main content](https://shopify.dev/docs/api/liquid/tags/doc#main-content) Documents template elements with annotations. The `doc` tag allows developers to include documentation within Liquid templates. Any content inside `doc` tags is not rendered or outputted. Liquid code inside will be parsed but not executed. This facilitates tooling support for features like code completion, linting, and inline documentation. For detailed documentation syntax and examples, see the [`LiquidDoc` reference](https://shopify.dev/docs/storefronts/themes/tools/liquid-doc) . Syntax ------ 9 1 2 3 4 5 6 7 8 9 {% doc %} Renders a message. @param {string} foo - A string value. @param {string} \[bar\] - An optional string value. @example {% render 'message', foo: 'Hello', bar: 'World' %} {% enddoc %} Was this page helpful? YesNo --- # Liquid objects: all_country_option_tags [Skip to main content](https://shopify.dev/docs/api/liquid/objects/all_country_option_tags#main-content) Creates an `