The handle is used to access the attributes of a Liquid object. By default, it is the object’s title in lowercase with any spaces and special characters replaced by hyphens (-). Every object in Liquid (product, collection, blog, menu) has a handle.
Learn more
What is a handle?
The handle is used to access the attributes of a Liquid object. By default, it is the object’s title in lowercase with any spaces and special characters replaced by hyphens (-). Every object in Liquid (product, collection, blog, menu) has a handle.
Learn more
<!-- the content of the About Us page -->
{{ pages.about-us.content }}
How are my handles created?
A product with the title ‘shirt’ will automatically be given the handle shirt. If there is already a product with the handle ‘shirt’, the handle will auto-increment. In other words, all ‘shirt’ products created after the first one will receive the handle shirt-1, shirt-2, and so on.
Learn more
Operators
Liquid has access to all of the logical and comparison operators. These can be used in tags such as if and unless.
Learn more
checks for the presence of a substring inside a string or array
Learn more
{% if product.title contains 'Pack' %}
This product’s title contains the word Pack.
{% endif %}
Types
Liquid objects can return one of six types: String, Number, Boolean, Nil, Array, or EmptyDrop. Liquid variables can be initialized by using the assign or capture tags.
Learn more
Strings
Strings are declared by wrapping the variable’s value in single or double quotes.
Learn more
Booleans are either true or false. No quotations are necessary when declaring a boolean.
Learn more
{% assign foo = true %}
{% assign bar = false %}
Nil
Nil is an empty value that is returned when Liquid code has no results. It is not a string with the characters ‘nil’. Nil is treated as false in the conditions of {% if %} blocks and other Liquid tags that check for the truthfulness of a statement.
Learn more
Arrays
Arrays hold a list of variables of all types. To access items in an array, you can loop through each item in the array using a for tag or a tablerow tag.
Learn more
{% for tag in product.tags %}
{{ tag }}
{% endfor %}
EmptyDrop
An EmptyDrop object is returned whenever you try to access a non-existent object (for example, a collection, page or blog that was deleted or hidden) by a handle.
Learn more
Truthy and Falsy
In programming, we describe “truthy” and “falsy” as anything that returns true or false, respectively, when used inside an if statement.
Learn more
What is truthy?
All values in Liquid are truthy, with the exception of nil and false. In this example, the variable is a string type but it evaluates as true.
Learn more
{% assign tobi = 'tobi' %}
{% if tobi %}
This will always be true.
{% endif %}
What is falsy?
The only values that are falsy in Liquid are nil and false. nil is returned when a Liquid object doesn’t have anything to return. For example, if a collection doesn’t have a collection image, collection.image will be set to nil.
Learn more
In Liquid, you can include a hyphen in your tag syntax {{-, -}}, {%-, and -%} to strip whitespace from the left or right side of a rendered tag.
Normally, even if it doesn’t output text, any line of Liquid in your template will still output an empty line in your rendered HTML.
Learn more
Whitespace Control
Using hyphens, the assign statement doesn't output a blank line.
Learn more
Conditional tags define conditions that determine whether blocks of Liquid code get executed.
Learn more
{% if %}
Executes a block of code only if a certain condition is met.
Learn more
{% if product.title == 'Awesome Shoes' %}
These shoes are awesome!
{% endif %}
These shoes are awesome!
{% elsif %} / {% else %}
Adds more conditions within an if or unless block.
Learn more
<!-- If customer.name is equal to 'anonymous' -->
{% if customer.name == 'kevin' %}
Hey Kevin!
{% elsif customer.name == 'anonymous' %}
Hey Anonymous!
{% else %}
Hi Stranger!
{% endif %}
Hey Anonymous!
{% case %} / {% when %}
Creates a switch statement to compare a variable with different values. case initializes the switch statement and when compares its values.
Learn more
{% assign handle = 'cake' %}
{% case handle %}
{% when 'cake' %}
This is a cake
{% when 'cookie' %}
This is a cookie
{% else %}
This is not a cake nor a cookie
{% endcase %}
This is a cake
{% unless %}
Similar to if, but executes a block of code only if a certain condition is not met.
Learn more
{% unless product.title == 'Awesome Shoes' %}
These shoes are not awesome.
{% endunless %}
These shoes are not awesome.
HTML Tags
HTML tags render HTML elements using Shopify-specific attributes.
Learn more
{% form %}
Generates an HTML form tag, including any required input tags to submit the form to a specific endpoint.
Learn more
{% form 'form_type' %}
content
{% endform %}
{% style %}
Generates an HTML style tag with an attribute of data-shopify.
Learn more
{% for product in collection.products %}
{{ product.title }}
{% endfor %}
hat shirt pants
{% else %}
Specifies a fallback case for a for loop which will run if the loop has zero length (for example, you loop over a collection that has no products).
Learn more
{% for product in collection.products %}
{{ product.title }}
{% else %}
This collection is empty.
{% endfor %}
This collection is empty.
{% break %}
Causes the loop to stop iterating when it encounters the break tag.
Learn more
{% for i in (1..5) %}
{% if i == 4 %}
{% break %}
{% else %}
{{ i }}
{% endif %}
{% endfor %}
1 2 3
{% continue %}
Causes the loop to skip the current iteration when it encounters the continue tag.
Learn more
{% for i in (1..5) %}
{% if i == 4 %}
{% continue %}
{% else %}
{{ i }}
{% endif %}
{% endfor %}
1 2 3 5
{% cycle %}
Loops through a group of strings and outputs them in the order that they were passed as parameters. Each time cycle is called, the next string that was passed as a parameter is output.
Learn more
Syntax tags control how Liquid code is processed and rendered.
Learn more
{% comment %}
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.
Learn more
Allows you to have a block of Liquid without delimeters on each tag.
Learn more
{% 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
%}
This is a health potion!
{% raw %}
Outputs any Liquid code as text instead of rendering it.
Learn more
Theme Tags have various functions including: outputting template-specific HTML markup, telling the theme which layout and snippets to use, and splitting a returned array into multiple pages.
Learn more
{% include %}
Inserts a snippet from the snippets folder of a theme.
Learn more
{% javascript %}
JavaScript code included in a section file.
Learn more
Loads an alternate template file from the layout folder of a theme. If no alternate layout is defined, the theme.liquid template is loaded by default.
Learn more
{% render %}
Renders a snippet from the snippets folder of a theme.
When a snippet is rendered, the code inside it does not have access to the variables assigned within its parent template. Similarly, variables assigned within the snippet can't be accessed by the code outside of the snippet. This encapsulation increases performance and helps make theme code easier to understand and maintain.
Learn more
{% section %}
Inserts a section from the sections folder of a theme.
Learn more
{% section 'footer' %}
<div id="shopify-section-footer" class="shopify-section">
<!-- content of sections/footer.liquid -->
</div>
{% sections %}
Renders a section group. Use this tag to render section groups as part of the theme's layout content. Place the sections tag where you want to render it in the layout.
Learn more
{% assign my_variable = false %}
{% if my_variable != true %}
This statement is valid.
{% endif %}
This statement is valid.
{% capture %}
Captures the string inside of the opening and closing tags and assigns it to a variable. Variables created through {% capture %} are strings.
Learn more
{% capture my_variable %}I am being captured.{% endcapture %}
{{ my_variable }}
I am being captured.
{% increment %}
Creates a new number variable, and increases its value by one every time it is called. The initial value is 0.
Learn more
Returns the item at the specified index in an array. Note that array numbering starts from zero, so the first item in an array is referenced with [0].
Learn more
Color filters change or extract properties from CSS color strings. These filters are commonly used with color theme settings.
Learn more
brightness_difference
Calculates the perceived brightness difference between two colors. With regards to accessibility, the W3C suggests that the brightness difference should be greater than 125.
Learn more
Calculates the perceived brightness of the given color.
Learn more
{{ '#7ab55c' | color_brightness }}
153.21
color_contrast
Calculates the contrast ratio between two colors. Returns the numerator part of the ratio, which has a denominator of 1. For example, for a contrast ratio of 3.5:1, the filter returns 3.5.
Learn more
{{ '#495859' | color_contrast: '#fffffb' }}
7.4
color_darken
Darkens the input color. Takes a value between 0 and 100 percent.
Learn more
{{ '#7ab55c' | color_darken: 30 }}
#355325
color_desaturate
Desaturates the input color. Takes a value between 0 and 100 percent.
Learn more
{{ '#7ab55c' | color_desaturate: 30 }}
#869180
color_difference
Calculates the color difference or distance between two colors. With regards to accessibility, the W3C suggests that the color difference should be greater than 500.
Learn more
{{ '#ff0000' | color_difference: '#abcdef' }}
528
color_extract
Extracts a component from the color. Valid components are alpha, red, green, blue, hue, saturation and lightness.
Learn more
{{ '#7ab55c' | color_extract: 'red' }}
122
color_lighten
Lightens the input color. Takes a value between 0 and 100 percent.
Learn more
{{ '#7ab55c' | color_lighten: 30 }}
#d0e5c5
color_mix
Blends together two colors. Blend factor should be a value between 0 and 100 percent.
Learn more
{{ '#7ab55c' | color_mix: '#ffc0cb', 50 }}
#bdbb94
color_modify
Modifies the given component of a color (rgb, alpha, hue and saturation). The filter will return a color type that includes the modified format — for example, if you modify the alpha channel, the filter will return the color in rgba() format, even if your input color was in hex format.
Learn more
Converts a CSS color string to hex6 format. Hex output is always in hex6 format. If there is an alpha channel in the input color, it will not appear in the output.
Learn more
font_modify takes two arguments. The first indicates which property should be modified and the second is the modification to be made.
While you can access every variant of the chosen font's family by using font.variants, you can more easily access specific styles and weights by using the font_modify filter.
Learn more
Returns a CDN URL for the chosen font. By default, font_url returns the woff2 version, but it can also be called with an additional parameter to specify the format. Both woff and woff2 are supported.
Learn more
The time_tag filter converts a timestamp into an HTML <time> tag. The output format can be customized by passing date parameters to the time_tag filter.
Learn more
Generates an HTML address display, with each address component ordered according to the address's locale.
Learn more
{{ shop.address | format_address }}
<p>Polina's Potions, LLC<br>150 Elgin Street<br>8th floor<br>Ottawa ON K2P 1L4<br>Canada</p>
t (translate)
Returns a string of translated text for a given translation key from a locale file. The translate filter has an alias of t, which is more commonly used.
Learn more
Math Filters
Math filters can be linked and are applied in order from left to right, as with all other filters
Learn more
abs
Returns the absolute value of a number or string that onnly contains a number.
Learn more
<video playsinline="true" controls="">
<source src="https://videos.shopifycdn.com/c/vp/afe4b8a92ca944e49bc4b888927b7ec3/master.m3u8?Expires=1560458164&KeyName=core-signing-key-1&Signature=BIQQpuyEVnyt9HUw4o9QOmQ1z2c=" type="application/x-mpegURL">
<source src="https://videos.shopifycdn.com/c/vp/afe4b8a92ca944e49bc4b888927b7ec3/SD-360p.mp4?Expires=1560458164&KeyName=core-signing-key-1&Signature=1kEi8GmNIssxVvjyzy7AOuGP-E0=" type="video/mp4">
<source src="https://videos.shopifycdn.com/c/vp/afe4b8a92ca944e49bc4b888927b7ec3/SD-480p.mp4?Expires=1560458164&KeyName=core-signing-key-1&Signature=8Lt74XmFWP6hOF1WRdqNkDWRm2U=" type="video/mp4">
<source src="https://videos.shopifycdn.com/c/vp/afe4b8a92ca944e49bc4b888927b7ec3/HD-720p.mp4?Expires=1560458164&KeyName=core-signing-key-1&Signature=vlNXWpvgRT2bghrWovJPrN8w3mc=" type="video/mp4"><p>Sorry html5 video is not supported in this browser</p>
</video>
Metafield Filters
Metafield filters can output metafield data from a metafield object within a relevant HTML element, or as a plain string.
Learn more
metafield_tag
Generates an HTML element depending on the type of metafield.
Learn more
<!-- if single_line_text_field metafields output the text inside a <span> element with an attribute of class="metafield-single_line_text_field". -->
<span class="metafield-single_line_text_field">This is a single line of text.</span>
metafield_text
Generates a text version of the metafield data.
Learn more
Converts a string into a SHA-1 hash using a hash message authentication code (HMAC). Pass the secret key for the message as a parameter to the filter.
Learn more
{% assign my_secret_string = "ShopifyIsAwesome!" | hmac_sha1: "secret_key" %}
My encoded string is: {{ my_secret_string }}
My encoded string is: 30ab3459e46e7b209b45dba8378fcbba67297304
hmac_sha256
Converts a string into a SHA-256 hash using a hash message authentication code (HMAC). Pass the secret key for the message as a parameter to the filter.
Learn more
{% assign my_secret_string = "ShopifyIsAwesome!" | hmac_sha256: "secret_key" %}
My encoded string is: {{ my_secret_string }}
My encoded string is: 30ab3459e46e7b209b45dba8378fcbba67297304
Inserts a <br> linebreak HTML tag in front of each line break in a string.
Learn more
{% capture var %}
One
Two
Three
{% endcapture %}
{{ var | newline_to_br }}
One<br>
Two<br>
Three<br>
pluralize
Outputs the singular or plural version of a string based on the value of a number. The first parameter is the singular string and the second parameter is the plural string.
Learn more
The slice filter returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring of one character will be returned.
Learn more
The split filter takes on a substring as a parameter. The substring is used as a delimiter to divide a string into an array. You can output different parts of an array using array filters.
Learn more
{% assign words = "Hi, how are you today?" | split: ' ' %}
{% for word in words %}
{{ word }}
{% endfor %}
Hi,
how
are
you
today?
strip
Strips tabs, spaces, and newlines (all whitespace) from the left and right side of a string.
Learn more
{{ ' too many spaces ' | strip }}
too many spaces
lstrip
Strips tabs, spaces, and newlines (all whitespace) from the left side of a string.
Learn more
"{{ ' too many spaces ' | lstrip }}"
<!-- Notice the empty spaces to the right of the string -->
"too many spaces "
reverse
reverse cannot be used directly on a string, but you can split a string into an array, reverse the array, and rejoin it by chaining together other filters.
Learn more
{{ "Ground control to Major Tom." | split: "" | reverse | join: "" }}
.moT rojaM ot lortnoc dnuorG
rstrip
Strips tabs, spaces, and newlines (all whitespace) from the right side of a string.
Learn more
Removes any line breaks/newlines from a string.
Learn more
<!-- product.description = "This is a multiline\nproduct description."
{{ product.description | strip_newlines }}
This is a multiline product description.
truncate
Truncates a string down to ‘x’ characters, where x is the number passed as a parameter. An ellipsis (...) is appended to the string and is included in the character count.
Learn more
{{ "The cat came back the very next day" | truncate: 10 }}
The cat...
truncatewords
Truncates a string down to ‘x’ words, where x is the number passed as a parameter. An ellipsis (...) is appended to the truncated string.
Learn more
{{ "The cat came back the very next day" | truncatewords: 4 }}
Converts any URL-unsafe characters in a string into percent-encoded characters.
Learn more
{{ "john@liquid.com" | url_encode }}
john%40liquid.com
url_escape
Identifies all characters in a string that are not allowed in URLS, and replaces the characters with their escaped variants.
Learn more
{{ "<hello> & <shopify>" | url_escape }}
%3Chello%3E%20&%20%3Cshopify%3E
url_param_escape
Replaces all characters in a string that are not allowed in URLs with their escaped variants, including the ampersand (&).
Learn more
{{ "<hello> & <shopify>" | url_param_escape }}
%3Chello%3E%20%26%20%3Cshopify%3E
additional_checkout_buttons
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 to show the associated checkout buttons.
Learn more
additional_checkout_buttons
Returns true if a store has any payment providers with offsite checkouts, such as PayPal Express Checkout.
Learn more
{% if additional_checkout_buttons %}
{{ content_for_additional_checkout_buttons }}
{% endif %}
address
The address object contains information entered by a customer in Shopify’s checkout pages. Note that a customer can enter two addresses: billing address or shipping address. When accessing attributes of the address object, you must specify which address you want to target. This is done by using either shipping_address or billing_address before the attribute.
Learn more
address.name
Returns the values of the First Name and Last Name fields of the address.
Learn more
Hello, {{ billing_address.name }}
address.first_name
Returns the value of the First Name field of the address.
Learn more
address.last_name
Returns the value of the Last Name field of the address.
Learn more
address.address1
Returns the value of the Address1 field of the address.
Learn more
address.address2
Returns the value of the Address2 field of the address.
Learn more
address.street
Returns the combined values of the Address1 and Address2 fields of the address.
Learn more
{{ shipping_address.street }}
address.company
Returns the value of the Company field of the address.
Learn more
address.city
Returns the value of the City field of the address.
Learn more
address.province
Returns the value of the Province/State field of the address.
Learn more
address.province_code
Returns the abbreviated value of the Province/State field of the address.
Learn more
address.zip
Returns the value of the Postal/Zip field of the address.
Learn more
address.country
Returns the value of the Country field of the address.
Learn more
address.country_code
Returns the value of the Country field of the address in ISO 3166-2 standard format.
Learn more
address.phone
Returns the value of the Phone field of the address.
Learn more
all_country_option_tags
The all_country_option_tags object creates an option tag for each country. An attribute called data-provinces is set for each option, and contains a JSON-encoded array of the country's subregions. If a country doesn't have any subregions, then an empty array is set for its data-provinces attribute.
Learn more
all_country_option_tags
The all_country_option_tags object should be wrapped in select tags.
Learn more
Returns the article image. Use the img_url filter to link it to the image file on the Shopify CDN. Check for the presence of the image first.
Learn more
{% for tag in article.tags %}
{{ tag }}
{% endfor %}
article.updated_at
Returns returns a timestamp for when a blog article was updated. The date filter can be applied to format the timestamp.
Learn more
article.url
Returns the relative URL of the article.
Learn more
article.user
Returns an object with information about the article's author. This information can be edited in the Staff accounts options on the Account page in the Shopify admin.
Learn more
articles
All of the articles across the blogs in the store.
Learn more
articles
All of the articles across the blogs in the store. You can use articles to access an article by its handle.
Learn more
<a href="/blogs/potion-notions/new-potions-for-spring" title="">New potions for spring</a>
block
A block represents the content and settings of a single block in an array of section blocks. The block object can be accessed in a section file by looping through section.blocks.
Learn more
block.id
Returns a unique ID dynamically generated by Shopify.
Learn more
block.settings
Returns an object of the block settings set in the theme editor. Retrieve setting values by referencing the setting's unique id.
Learn more
block.shopify_attributes
Returns a string representing the block's attributes. The theme editor's JavaScript API uses a block's shopify_attributes to identify blocks and listen for events. No value for block.shopify_attributes is returned outside the theme editor.
Learn more
block.type
Returns the type defined in the block's schema. This is useful for displaying different markup based on the block.type.
Learn more
Allows you to access all of the blogs in the store. You can use blogs to access a blog by its handle.
Learn more
{% for article in blogs.potion-notions.title %}
{{ article.title | link_to: article.url }}
{% endfor %}
<a href="/blogs/potion-notions/homebrew-start-making-potions-at-home" title="">Homebrew: start making potions at home</a>
<a href="/blogs/potion-notions/new-potions-for-spring" title="">New potions for spring</a>
<a href="/blogs/potion-notions/how-to-tell-if-you-have-run-out-of-invisibility-potion" title="">How to tell if you're out of invisibility potion</a>
"Canada's foremost retailer for potions and potion accessories. Try one of our award-winning artisanal potions, or find the supplies to make your own!"
The colors defined as part of a store's brand assets.
Learn more
brand_color
The colors defined as part of a store's brand assets. To access a brand color, specify the brand color group, the color role, and the 0-based index of the color within the group and role.
Learn more
The canonical URL for the current page.
Learn more
canonical_url
The canonical URL for the current page.
Learn more
cart
The cart object can be used and accessed from any file in your theme.
Learn more
cart.attributes
cart.attributes allow the capturing of more information on the cart page. This is done by giving an input a name attribute with the following syntax: attributes[attribute-name].
Learn more
{{ cart.attributes.your-pet-name }}
Rex
cart.currency
Returns the currency of the cart. If your store uses multi-currency, then the cart.currency is the same as the customer's local (presentment) currency. Otherwise, the cart currency is the same as your store currency.
Learn more
{{ cart.currency.iso_code }}
USD
cart.item_count
Returns the number of items inside the cart.
Learn more
Returns all of the line items in the cart.
Learn more
cart.items_subtotal_price
Returns the sum of the cart's line-item prices after any line-item discount. The subtotal doesn't include taxes (unless taxes are included in the prices), cart discounts, or shipping costs.
Learn more
cart.note
cart.note allows the capturing of more information on the cart page.
Learn more
cart.original_total_price
Returns the subtotal of the cart before any discounts have been applied. The amount is in the customer's local (presentment) currency.
Learn more
cart.total_discount
Returns the total of all discounts (the amount saved) for the cart. The amount is in the customer's local (presentment) currency.
Learn more
cart.total_price
Returns the total price of all of the items in the cart.
Learn more
cart.total_weight
Returns the total weight, in grams, of all of the items in the cart. Use the weight_with_unit filter to format the weight.
Learn more
checkout
The checkout object can be accessed in the order status page of the checkout. Shopify Plus merchants can also access properties of the checkout object in the checkout.liquid layout file.
Learn more
checkout.applied_gift_cards
Returns the gift cards applied to the checkout.
Learn more
checkout.attributes
Returns the attributes of the checkout that were captured in the cart.
Learn more
checkout.billing_address
Returns the billing address of the checkout.
Learn more
checkout.buyer_accepts_marketing
Returns whether the buyer accepted the newsletter during the checkout.
Learn more
{% if checkout.buyer_accepts_marketing %}
Thank you for subscribing to our newsletter. You will receive our exclusive newsletter deals!
{% endif %}
checkout.customer
Returns the customer associated with the checkout.
Learn more
checkout.discount_applications
Returns an array of discount applications for a checkout.
Learn more
{% for discount_application in checkout.discount_applications %}
Discount name: {{ discount_application.title }}
Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
Discount name: SUMMER19
Savings: -$20.00
checkout.discounts
Returns the discounts applied to the checkout.
Learn more
{% for discount in checkout.discounts %}
* {{ discount.code }}: {{ discount.amount | money }}
{% endfor %}
* secret-discount: $12.00
checkout.discounts_amount
Returns the sum of the amount of the discounts applied to the checkout. Use one of the money filters to return the value in a monetary format.
Learn more
You save: {{ checkout.discounts_amount | money }}
You save: $12.00
checkout.discounts_savings
Returns the sum of the savings of the discounts applied to the checkout. The negative opposite of discounts_amount. Use one of the money filters to return the value in a monetary format.
Learn more
checkout.email
Returns the email used during the checkout.
Learn more
checkout.gift_cards_amount
Returns the amount paid in gift cards of the checkout. Use one of the money filters to return the value in a monetary format.
Learn more
Returns the order created by the checkout. Depending on the payment gateway, the order might not have been created yet on the checkout order status page and this property could be nil.
Learn more
checkout.order_id
Returns the id of the order created by the checkout. Depending on the payment gateway, the order might not have been created yet on the checkout order status page.
Learn more
checkout.order_name
Returns the name of the order created by the checkout. Depending on the payment gateway, the order might not have been created yet on the checkout order status page.
Learn more
checkout.order_number
Returns the number of the order created by the checkout. Depending on the payment gateway, the order might not have been created yet on the checkout order status page.
Learn more
checkout.requires_shipping
Returns whether the checkout as a whole requires shipping, that is, whether any of the line items require shipping.
Learn more
{% if checkout.requires_shipping %}
You will receive an email with your shipment tracking number as soon as your order is shipped.
{% endif %}
checkout.shipping_address
Returns the shipping address of the checkout.
Learn more
checkout.shipping_method
Returns the shipping method of the checkout.
Learn more
checkout.shipping_methods
Returns an array of shipping methods of the checkout.
Learn more
Shipping methods:
{% for shipping_method in checkout.shipping_methods %}
* {{ shipping_method.title }}: {{ shipping_method.price | money }}
{% endfor %}
Shipping methods:
* International Shipping: $12.00
checkout.shipping_price
Returns the shipping price of the checkout. Use one of the money filters to return the value in a monetary format.
Learn more
checkout.subtotal_price
Returns the subtotal price of the checkout, that is before shipping and before taxes, unless they are included in the prices.
Learn more
checkout.tax_lines
Returns all the tax lines of the checkout.
Learn more
checkout.tax_price
Returns the tax price of the checkout, whether the taxes are included or not in the prices. Use one of the money filters to return the value in a monetary format.
Learn more
checkout.total_price
Returns the total price of the checkout. Use one of the money filters to return the value in a monetary format.
Learn more
Total: {{ checkout.total_price | money }}
Total: $26.75
checkout.transactions
Returns an array of transactions from the checkout.
Learn more
Returns the number of products in a collection. collection.all_products_count will return the total number of products even when the collection view is filtered.
Learn more
{{ collection.all_products_count }} total products in this collection
24 total products in this collection
collection.all_tags
Returns a list of all product tags in a collection. collection.all_tags will return the full list of tags even when the collection view is filtered.
collection.all_tags will return at most 1,000 tags.
Learn more
collection.all_types
Returns a list of all product types in a collection.
Learn more
{% for product_type in collection.all_types %}
{{ product_type | link_to_type }}
{% endfor %}
Returns the product type on a /collections/types?q=TYPE collection page. For example, you may be on the automatic Shirts collection, which lists all products of type ‘shirts’ in the store: myshop.shopify.com/collections/types?q=Shirts.
Learn more
{% if collection.current_type %}
We are on an automatic product type collection page. The product type is {{ collection.current_type }}.
{% endif %}
collection.current_vendor
Returns the vendor name on a /collections/vendors?q=VENDOR collection page. For example, you may be on the automatic Shopify collection, which lists all products with vendor ‘shopify’ in the store: myshop.shopify.com/collections/vendors?q=Shopify.
Learn more
{% if collection.current_vendor %}
We are on an automatic vendor collection page. The vendor is {{ collection.current_vendor }}.
{% endif %}
collection.default_sort_by
Returns the sort order of the collection, which is set in the collection pages of the Admin.
Learn more
collection.description
Returns the description of the collection.
Learn more
collection.featured_image
Returns the featured image for the collection. The default is the collection image, and then Shopify will fall back to an appropriate image, such as the featured image of the first product in the collection.
Learn more
collection.filters
Returns an array of filter objects that have been set up on the collection.
Learn more
Returns the collection image. Use the img_url filter to link it to the image file on the Shopify CDN. Check for the presence of the image first.
Learn more
Returns the URL of the next product in the collection. Returns nil if there is no next product. This output can be used on the product page to output ‘next’ and ‘previous’ links on the product.liquid template.
Learn more
collection.previous_product
Returns the URL of the previous product in the collection. Returns nil if there is no previous product. This output can be used on the product page to output ‘next’ and ‘previous’ links on the product.liquid template.
Learn more
collection.products
Returns all of the products inside a collection. Note that there is a limit of 50 products that can be shown per page. Use the pagination tag to control how many products are shown per page.
Learn more
collection.products_count
Returns the number of products in a collection.
Learn more
Returns the date and time when the collection was published. You can set this information on the collection's page in your Shopify admin by the Set publish date calendar icon. You can use a date filter to format the date.
Learn more
collection.sort_by
Returns the sort order applied to the collection by the sort_by URL parameter. When there is no sort_by URL parameter, the value is null (e.g. /collections/widgets?sort_by=best-selling).
Learn more
Returns an array of sorting options for the collection.
Learn more
<select name="sort_by">
{% for option in collection.sort_options %}
<option value="{{ option.value }}">{{ option.name }}</option>
{% endfor %}
</select>
<select name="sort_by">
<option value="manual">Featured</option>
<option value="best-selling">Best selling</option>
<option value="title-ascending">Alphabetically, A-Z</option>
<option value="title-descending">Alphabetically, Z-A</option>
<option value="price-ascending">Price, low to high</option>
<option value="price-descending">Price, high to low</option>
<option value="created-ascending">Date, old to new</option>
<option value="created-descending">Date, new to old</option>
</select>
collection.template_suffix
Returns the name of the custom collection template assigned to the collection, without the collection prefix or the .liquid suffix. Returns nil if a custom template is not assigned to the collection.
Learn more
Returns the timestamp of when the comment's status was last changed. For example, the timestamp of when a comment was approved by the article's author.
Use the date filter to convert the timestamp into a more readable format.
Learn more
{{ comment.updated_at | date: "%b %d, %Y" }}
Mar 13, 2019
comment.url
Returns the URL of the article with comment.id appended to it. This is so the page will automatically scroll to the comment.
Learn more
company
A company that a customer is purchasing for.
Learn more
company.available_locations
The company locations that the current customer has access to, or can interact with.
Learn more
Returns checkout buttons for any active payment providers with offsite checkouts.
Learn more
content_for_additional_checkout_buttons
Use additional_checkout_buttons to check whether these payment providers exist, and content_for_additional_checkout_buttons to show the associated checkout buttons.
Learn more
{% if additional_checkout_buttons %}
{{ content_for_additional_checkout_buttons }}
{% endif %}
content_for_header
Dynamically returns all scripts required by Shopify.
Learn more
content_for_header
Include the content_for_header object in your layout files between the opening and closing head HTML tags. You shouldn't try to modify or parse the content_for_header object because the contents are subject to change, which can change the behavior of your code.
Learn more
content_for_index
Dynamically returns the content of sections to be rendered on the home page.
Learn more
content_for_index
If you use a Liquid index template (templates/index.liquid), then you must include {{ content_for_index }} in the template. This object can't be used in JSON index templates.
Learn more
content_for_layout
Dynamically returns content based on the current template.
Learn more
content_for_layout
Include the content_for_layout object in your layout files between the opening and closing body HTML tags.
Learn more
country
The country object has the following attributes.
Learn more
country.currency
Returns the currency used in the country.
Learn more
country.iso_code
Returns the ISO code of the country. For example, US or FR for United States or France.
Learn more
country.name
Returns the name of the country. For example, United States or France.
Learn more
country.unit_system
Returns the unit system of the country. Can be either imperial or metric.
Learn more
country_option_tags creates an <option> tag for each country. An attribute named data-provinces is set for each country, containing JSON-encoded arrays of the country’s respective subregions. If a country does not have any subregions, an empty array is set for its data-provinces attribute. country_option_tags must be wrapped in <select> HTML tags.
Learn more
Product tags are used to filter a collection to only show products that contain a specific product tag. Similarly, article tags are used to filter a blog to only show products that contain a specific article tag. The current_tags variable is an array that contains all tags that are being used to filter a collection or blog.
Learn more
Inside collection.liquid
Inside collection.liquid, current_tags contains all product tags that are used to filter a collection.
Learn more
Inside blog.liquid
Inside blog.liquid, current_tags contains all article tags that are used to filter the blog.
Learn more
customer_address
The customer_address object contains information of addresses tied to a Customer Account.
Learn more
customer_address.first_name
Returns the value of the First Name field of the address.
Learn more
customer_address.last-name
Returns the value of the Last Name field of the address.
Learn more
customer_address.address1
Returns the value of the Address1 field of the address.
Learn more
customer_address.address2
Returns the value of the Address2 field of the address.
Learn more
customer_address.street
Returns the combined values of the Address1 and Address2 fields of the address.
Learn more
customer_address.company
Returns the value of the Company field of the address.
Learn more
customer_address.city
Returns the value of the City field of the address.
Learn more
customer_address.province
Returns the value of the Province/State field of the address.
Learn more
customer_address.province_code
Returns the abbreviated value of the Province/State field of the address.
Learn more
customer_address.zip
Returns the value of the Postal/Zip field of the address.
Learn more
customer_address.country
Returns the value of the Country field of the address.
Learn more
customer_address.country_code
Returns the value of the Country field of the address in ISO 3166-2 standard format.
Learn more
{{ customer_address.country_code }}
CA
customer_address.phone
Returns the value of the Phone field of the address.
Learn more
The customer object contains information about a customer who has a Customer Account. The customer can be used and accessed from any file in your theme.
Learn more
customer.accepts_marketing
Returns true if the customer accepts marketing. Returns false if the customer does not.
Learn more
customer.addresses
Returns an array of all addresses associated with a customer. See customer_address for a full list of available attributes.
Learn more
{% for address in customer.addresses %}
{{ address.street }}
{% endfor %}
126 York St, Suite 200 (Shopify Office)
123 Fake St
53 Featherston Lane
customer.addresses_count
Returns the number of addresses associated with a customer.
Learn more
Returns the email address of the customer.
Learn more
customer.first_name
Returns the first name of the customer.
Learn more
customer.has_account
Returns true if the email associated with an order is also tied to a Customer Account. Returns false if it is not. Helpful in email templates. In the theme, this will always be true.
Learn more
Returns the title or discount code of the discount.
Learn more
{{ discount.title }}
SPRING14
discount.code
Returns the title or discount code of the discount. Same as discount.title.
Learn more
discount.amount
Returns the amount of the discount. Use one of the money filters to return the value in a monetary format.
Learn more
{{ discount.amount | money }}
$25
discount.total_amount
Returns the total amount of the discount if it has been applied to multiple line items. Use a money filter to return the value in a monetary format.
Learn more
discount.savings
Returns the amount of the discount’s savings. The negative version of amount. Use one of the money filters to return the value in a monetary format.
Learn more
{{ discount.savings | money }}
$-25
discount.total_savings
Returns the total amount of the discount’s savings if it has been applied to multiple line items. The negative version of total_amount. Use a money filter to return the value in a monetary format.
Learn more
The discount_allocation object contains all of the information about how a particular discount affects a line item and how the price reduces. The object can be accessed on customer order and notification templates. Shopify Plus merchants can also access properties of the discount_allocation object in the checkout.liquid layout file.
Learn more
discount_allocation.amount
The discounted amount on a line item by a particular discount.
Learn more
discount_allocation.discount_application
The discount application that allocates the amount on the line item.
Learn more
discount application
The discount_application object captures the intent of a discount applied on an order. The object can be accessed on customer order and notification templates. Shopify Plus merchants can also access properties of the discount_allocation object in the checkout.liquid layout file.
Learn more
discount_application.target_selection
Describes how a discount selects line items in the cart to be discounted. target_selection has the following possible values:
all: The discount applies to all line items. entitled: The discount applies to a particular subset of line items, often defined by a condition. explicit: The discount applies to a specifically selected line item or shipping line.
Learn more
discount_application.target_type
Describes the type of item that a discount applies to. target_type has the following possible values:
The value type of the discount. value_type has the following possible values: fixed_amount percentageLearn more
external_video
The external_video object can be accessed from the product object's media attribute. It contains information about a Vimeo or YouTube video associated with a product.
Learn more
external_video.alt
Returns the alt tag of the video set on the product details page of the Shopify admin.
Learn more
external_video.aspect_ratio
Returns the aspect ratio of the external video.
Learn more
Returns the name of the video host (youtube or vimeo).
Learn more
external_video.id
Returns the media_id of the external video.
Learn more
external_video.media_type
Returns the type of the object (external_video). This can be used to filter the product object's media array.
Learn more
{% assign external_videos = product.media | where: "media_type", "external_video" %}
{% for external_video in external_videos %}
{{external_video.external_id}}
{% endfor %}
neFK-pv2sKY
JthaEfEsLYg
external_video.position
Returns the alt tag of the video set on the product details page of the Shopify admin.
Learn more
filter
The filter object represents a storefront filter.
Learn more
filter.active_values
Returns an array of filter_value objects that are currently active. Only applies to list type filters.
Learn more
filter.inactive_values
Returns an array of filter_value objects that are currently inactive. Only applies to list type filters.
Learn more
filter.label
Returns the customer-facing label for the filter.
Learn more
filter.max_value
Returns a filter_value object for the maximum value of price_range type filters.
Learn more
filter.min_value
Returns a filter_value object for the minimum value of price_range type filters.
Learn more
filter.param_name
Returns the name of the filter. For example, filter.v.option.color.
Learn more
filter.range_max
Returns the maximum product price within the current collection. This is only valid for filters of type price_range.
Learn more
filter.type
Returns the filter type. Can be list or price_range.
Learn more
filter.url_to_remove
Returns the current page URL with the filter's currently applied value parameters removed.
Learn more
If you want to remove the <code>Color</code> filter, then the <code>url_to_remove</code> attribute returns the following URL:
/collections/all?filter.v.option.size=L
filter.values
Returns an array of filter_value objects for a list type filter.
Learn more
filter_value
The filter_value object represents an individual value from a filter object.
Learn more
filter_value.active
Returns whether the filter value is active. Returns either true or false.
Learn more
filter_value.count
Returns how many results are related to the filter value. Returns a number.
Learn more
filter_value.label
Returns the customer facing label for the filter value. For example, Red or Rouge.
Learn more
filter_value.param_name
Returns the name of the filter that the filter value belongs to. For example, filter.v.option.color. Filters of type price_range also include an extra component depending on the filter_value source.
Learn more
If the filter_value is for a price_range filter's min_value, then the following is returned:
filter.v.price.lte
filter_value.url_to_add
Returns the current page URL with the filter value parameter added.
Learn more
filter_value.url_to_remove
Returns the current page URL with the filter value parameter removed.
Learn more
Returns true if the font is a system font. You can use this attribute to identify whether you need to embed the corresponding font-face for the font.
Learn more
Returns all of the variants within the font's family. Each of the variants is also a font object.
Learn more
{% for variant in settings.heading_font.variants %}
{{ variant.family }}
{% endfor %}
forloop
The forloop object contains attributes of its parent for loop.
Learn more
forloop.first
Returns true if it’s the first iteration of the for loop. Returns false if it is not the first iteration.
Learn more
{% for product in collections.frontpage.products %}
{% if forloop.first == true %}
First time through!
{% else %}
Not the first time.
{% endif %}
{% endfor %}
First time through!
Not the first time.
Not the first time.
Not the first time.
Not the first time.
forloop.index
Returns the current index of the for loop, starting at 1.
Learn more
{% for product in collections.frontpage.products %}
{{ forloop.index }}
{% else %}
// no products in your frontpage collection
{% endfor %}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
forloop.index0
Returns the current index of the for loop, starting at 0.
Learn more
{% for product in collections.frontpage.products %}
{{ forloop.index0 }}
{% endfor %}
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
forloop.last
Returns true if it’s the last iteration of the for loop. Returns false if it is not the last iteration.
Learn more
{% for product in collections.frontpage.products %}
{% if forloop.last == true %}
This is the last iteration!
{% else %}
Keep going…
{% endif %}
{% endfor %}
Keep going…
Keep going…
Keep going…
Keep going…
Keep going…
This is the last iteration!
forloop.rindex
Returns forloop.index in reverse order.
Learn more
{% for product in collections.frontpage.products %}
{{ forloop.rindex }}
{% endfor %}
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
forloop.rindex0
Returns forloop.index0 in reverse order.
Learn more
{% for product in collections.frontpage.products %}
{{ forloop.rindex0 }}
{% endfor %}
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
forloop.length
Returns the number of iterations of the for loop.
Learn more
<!-- if collections.frontpage.products contains 10 products -->
{% for product in collections.frontpage.products %}
{% capture length %}{{ forloop.length }}{% endcapture %}
{% endfor %}
{{ length }}
10
form
The form object is used within the form tag. It contains attributes of its parent form.
Learn more
form.address1
Returns the first address line associated with the address. Exclusive to form tags with the "address" parameter.
Learn more
form.address2
Returns the second address line associated with the address, if it exists. Exclusive to form tags with the "address" parameter.
Learn more
form.author
Returns the name of the author of the blog article comment. Exclusive to form tags with the "article" parameter.
Learn more
form.body
Returns the content of the blog article comment. Exclusive to form tags with the "article" parameter.
Learn more
form.city
Returns the city associated with the address. Exclusive to form tags with the "address" parameter.
Learn more
form.company
Returns the company name associated with the address, if it exists. Exclusive to form tags with the "address" parameter.
Learn more
form.country
Returns the country associated with the address. Exclusive to form tags with the "address" parameter.
Learn more
form.email
Returns the email address of the blog article comment’s author. Exclusive to form tags with the "article" parameter.
Learn more
form.country
Returns the country associated with the address. Exclusive to form tags with the "address" parameter.
Learn more
form.errors
Returns an array of strings if the form was not submitted successfully. The strings returned depend on which fields of the form were left empty or contained errors.
Learn more
{% for error in form.errors %}
{{ error }}
{% endfor %}
<!-- if the Name field was left empty by the user -->
author
form.first_name
Returns the first name associated with the address. Exclusive to form tags with the "address" parameter.
Learn more
form.id
Returns the id (unique identifier) of the form.
Learn more
form.last_name
Returns the last name associated with the address. Exclusive to form tags with the "address" parameter.
Learn more
form.password_needed
Used only for form tags with the "customer_login" parameter. The form.password_needed attribute always returns true.
Learn more
form.phone
Returns the telephone number associated with the address, if it exists. Exclusive to form tags with the "address" parameter.
Learn more
form.posted_successfully?
Returns true if the form was submitted successfully, or false if the form contained errors. All forms but the address form set this property. The address form is always submitted successfully.
Learn more
Returns the province or state associated with the address. Exclusive to form tags with the "address" parameter.
Learn more
{{ form.city }}, {{ form.province }}
San Francisco, California
form.set_as_default_checkbox
Renders an HTML checkbox that can submit the current form as the customer's default address. Exclusive to form tags with the "address" parameter.
Learn more
Returns an array of all line items and their quantity included in the fulfillment. Any line items that have already been fulfilled, or are yet to be fulfilled, will not be included in the array.
Learn more
We have fulfilled the following items:
<ul>
{% for line in fulfillment.fulfillment_line_items %}
<li>{{ line.line_item.title }} × {{ line.quantity }}</li>
{% endfor %}
</ul>
We have fulfilled the following items:
* T-shirt - White / Medium × 8
* Adorable boots × 1
fulfillment.item_count
Returns the total number of items included in the fulfillment.
Learn more
We have fulfilled {{ fulfillment.item_count }} items of your recent order.
We have fulfilled 3 items of your recent order.
generic_file
A file from a file_reference type metafield that is neither an image or video.
Learn more
The gift_card object can be accessed in the following templates: The Gift card created email notification template ‘Email Notifications > Gift card created’ . The gift_card.liquid template.
Learn more
gift_card.balance
Returns the amount of money remaining on the gift card.
Learn more
gift_card.code
Returns the code that was used to redeem the gift card.
Learn more
gift_card.currency
Returns the currency that the card was issued in.
Learn more
gift_card.customer
Returns the customer variable of the customer that the gift card is assigned to.
Learn more
Hey, {{ gift_card.customer.first_name }}!
Hey, Brian!
gift_card.enabled
Returns true if the card is enabled, or false if the card is disabled.
Learn more
gift_card.expired
Returns true if the card is expired, or false if the card is not.
Learn more
gift_card.expires_on
Returns the expiration date of the gift card.
Learn more
gift_card.initial_value
Returns the initial amount of money on the gift card.
Learn more
gift_card.product
Returns the product associated with the purchased gift card, or returns nothing if there is no associated product.
Learn more
gift_card.properties
Returns the line item properties assigned to the gift card when it was added to the cart.
Learn more
gift_card.url
Returns the unique URL that links to the gift card’s page on the shop (rendered through gift_card.liquid).
Learn more
group
The group object contains information about each default rule set in the robots object for the robots.txt file.
Learn more
group.rules
Returns of a list of rule objects for each rule in the group.
Learn more
group.sitemap
Returns the group's sitemap object. If the group doesn't require a sitemap, then this returns blank.
The handle of the resource associated with the current template.
Learn more
handle
The handle object will return a value only when an article, blog, collection, page, or product template is being viewed.
Learn more
image
The image object returns information about an image.
Learn more
image.alt
Returns the alt tag of the image, set in the Products page of the Admin.
Learn more
image.aspect_ratio
Returns the aspect ratio (width / height) of the image.
Learn more
image.attached_to_variant?
Returns true if the image has been associated with a variant. Returns false otherwise. This can be used in cases where you want to create a gallery of images that are not associated with variants.
Learn more
image.height
Returns the height of the image in pixels.
Learn more
Returns the relative path of the product image. This is the same as outputting {{ image }}.
Learn more
{% for image in product.images %}
{{ image.src }}
{{ image }}
{% endfor %}
products/my_image.jpg
products/my_image.jpg
image.variants
Returns an array of attributes for the variant that the image is associated with.
Learn more
{% for image in product.images %}
{% for variant in image.variants %}
{{ image.src }} - used for the variant: {{ variant.title }}
{% endfor %}
{% endfor %}
products/red-shirt.jpeg - used for the variant: Red
products/green-shirt.jpg - used for the variant: Green
products/yellow-shirt.jpg - used for the variant: Yellow
image.width
Returns the width of the image in pixels.
Learn more
image_presentation
The presentation settings for an image.
Learn more
A line item represents a single line in the shopping cart. There is one line item for each distinct product variant in the cart.
Learn more
line_item.discount_allocations
Returns a list of all discount allocations containing the discounted amount and the reference to the parent discount application. line_item.discount_allocations is available on line items in carts, checkouts, orders, and draft orders.
Learn more
line_item.final_line_price
Returns the combined price of all the items in the line item. This is equal to line_item.final_price times line_item.quantity.
Learn more
line_item.final_price
Returns the price of the line item including all line level discount amounts.
Learn more
line_item.fulfillment
Returns the fulfillment of the line item.
Learn more
line_item.fulfillment_service
Returns the fulfillment service associated with the line item's variant. Line items that have no fulfillment service will return manual.
Learn more
line_item.gift_card
Returns true if the line item's product is a gift card, or false if it is not.
Learn more
line_item.grams
Returns the weight of the line item. Use the weight_with_unit filter to format the weight.
Learn more
The line item ID differs depending on the context:
- cart.items returns the ID of the line item's variant. This ID is not unique, and can be shared by multiple items of the same variant.
- checkout.line_items returns a temporary unique hash generated for the checkout.
- order.line_items returns a unique integer ID.
Returns a unique identifier for each item in the cart.
Learn more
line_item.line_level_discount_allocations
Returns a list of line-specific discount_allocation objects containing the discounted amount and a reference to the parent discount application.
Learn more
line_item.line_level_total_discount
Returns the total amount of all discounts applied to the line item specifically. This doesn't include discounts that are added to the cart.
Learn more
line_item.message
Returns the discount message if a script has applied a discount to the line item. This attribute only has a value if you are using the Script Editor app.
Learn more
line_item.options_with_values
Returns an array of selected values from the item's product options.
Learn more
Returns true if the line item requires shipping, or false if it does not. This is set in the variant options in the Products page of the Admin.
Learn more
line_item.selling_plan_allocation
Returns a selling_plan_allocation object when the line item contains a selling plan.
Learn more
line_item.sku
Returns the SKU of the line item’s variant.
Learn more
line_item.successfully_fulfilled_quantity
Returns the successfully fulfilled quantity of the line item.
Learn more
line_item.taxable
Returns true if the line item is taxable, or false if it isn’t. This is set in the variant options in the Products page of the Admin.
Learn more
line_item.title
Returns the title of this line item. line_item.title combines both the line item’s product.title and the line item’s variant.title, separated by a hyphen.
Learn more
{{ line_item.title }}
Balloon Shirt - Medium
line_item.unit_price
Returns the unit price of the line item. The price reflects any discounts that are applied to the line item.
Learn more
line_item.unit_price_measurement
Returns a unit_price_measurement object for the line item.
Learn more
line_item.url
Returns the URL to the product page using variant deep-linking.
Learn more
Returns the id of the line item’s variant.
Learn more
line_item.vendor
Returns the vendor name of the line item’s product.
Learn more
link
The link object cannot be invoked on its own. It must be invoked inside a linklist.
Learn more
link.active
Returns true if the link is active, or false if the link is inactive.
Learn more
link.child_active
Similar to link.active, but returns true if a child link of the parent link is active, or false if no child links of the parent link are active.
Learn more
{{ linklists.main.title }}
{% for link in linklists.main.links %}
{{ link.title }}: child_active: {{ link.child_active }}
{% for sub_link in link.links %}
{{ sub_link.title }}: child_active: {{ sub_link.child_active }}
{% for sub_sub_link in sub_link.links %}
{{ sub_sub_link.title }}: active: {{ sub_sub_link.active }}
{% endfor %}
{% endfor %}
{% endfor %}
Main Menu
Home: child_active: false
About Us: child_active: true
In the news: child_active: false
Locations: child_active: true
Montreal: active: true
Ottawa: active: false
link.child_current
Returns true if a child link has a link object with link.current equal to true. Returns false if no child links have a link object with link.current equal to true.
Learn more
{{ linklists.main.title }}
{% for link in linklists.main.links %}
{{ link.title }}: child_current: {{ link.child_current }}
{% for sub_link in link.links %}
{{ sub_link.title }}: child_current: {{ sub_link.child_current }}
{% for sub_sub_link in sub_link.links %}
{{ sub_sub_link.title }}: current: {{ sub_sub_link.current }}
{% endfor %}
{% endfor %}
{% endfor %}
Main Menu
Home: child_current: false
About Us: child_current: true
In the news: child_current: false
Locations: child_current: true
Montreal: current: true
Ottawa: current: false
link.current
Returns true if the page content associated with the link is considered a match to the current page. Returns false if the content isn't considered a match.
Learn more
{% for link in linklists.main.links %}
<a href="{{ link.url }}"
{% if link.current %}aria-current="page" class="highlight"{% endif %}
>
{{ link.title }}
</a>
{% endfor %}
Returns the type of the link. The possible values are: collection_link: if the link points to a collection product_link: if the link points to a product page page_link: if the link points to a page blog_link: if the link points to a blog relative_link: if the link points to the search page, the home page or /collections/all http_link: if the link points to an external web page, or a type or vendor collection (e.g. /collections/types?q=Pants)
Learn more
Returns the number of nested levels that a linklist contains. Learn more
Given the following menu structure:
Main menu
└ Home
└ About Us
└ Locations
└ Montreal
└ Ottawa
{% assign menu = linklists.main-menu %}
{{ menu.title }}: {{ menu.levels }}
Main Menu: 3
linklist.links
Returns an array of links in the linklist.
Learn more
{% for link in linklists.main-menu.links %}
<a href="{{ link.url }}">{{ link.title }}</a>
{% endfor %}
The media object represents an object returned in a product.media array. The media object is an abstract object that can represent images, models, and videos associated with a product. You can use media filters to generate URLs and model-viewer tags so that media is rendered on the product page.
Learn more
media.alt
Returns the alt tag of the media, set in the Products page of the Admin.
Learn more
Returns the media type of the object. The media_type property can be used to filter the product.media array for all media of a desired type.
Learn more
Metafields make it possible to store additional information for articles, blogs, collections, customers, orders, pages, products, the shop, and variants. You can access the metafield object through the metafields attribute of these resources.
Learn more
metafield.list?
Returns true if the metafield is a list type. Returns false if not.
Learn more
A metaobject entry, which includes the values for a set of fields. The set is defined by the parent metaobject_definition.
Learn more
metaobject.system
Basic information about the metaobject. These properties are grouped under the system object to avoid collisions between system property names and user-defined metaobject fields.
Learn more
metaobject_definition
A metaobject definition defines the structure of a metaobject type for the store, which consists of a merchant-defined set of field definitions.
Learn more
metaobject_definition.values
The metaobjects that follow the definition.
Learn more
metaobject_definition.values_count
The total number of entries for the metaobject definition.
Learn more
metaobject_system
Basic information about a metaobject. These properties are grouped under the system object to avoid collisions between system property names and user-defined metaobject fields.
Learn more
The type of the metaobject definition. This is a free-form string that's defined when the metaobject definition is created.
Learn more
model
The model object can be accessed from the product object's media attribute. The model object contains information about a 3D model uploaded from the product details page in the Shopify admin.
Learn more
model.alt
Returns the alt tag of the model set on the product details page of the Shopify admin.
Learn more
Returns an array of model source objects.
Learn more
model_source
The model_source object can be accessed from the model object's sources array. The model_source object contains information about the source files for a model associated with a product.
Learn more
model_source.mime_type
Returns the MIME type of the model source file.
Learn more
model_source.format
Returns the format of the model source file.
Learn more
model_source.url
Returns the URL of the model source file.
Learn more
A money value, in the the customer's local (presentment) currency.
Learn more
money.currency
The customer's local (presentment) currency.
Learn more
order
The order object can be accessed in Liquid templates with customer.orders, in order email templates, and in apps such as Order Printer.
Learn more
order.attributes
Returns the custom cart attributes for the order, if there are any. You can add as many custom attributes to your cart as you like.
When you're looping through attributes, use {{ attribute | first }} to get the name of the attribute, and {{ attribute | last }} to get its value.
Learn more
{% if order.attributes %}
<p>Order notes:</p>
<ul>
{% for attribute in order.attributes %}
<li><strong>{{ attribute | first }}</strong>: {{ attribute | last }}</li>
{% endfor %}
</ul>
{% endif %}
<p>Order notes:</p>
<ul>
<li><strong>Message to merchant</strong>: I love your products! Thanks!</li>
</ul>
order.billing_address
Returns the billing address of the order.
Learn more
order.cancelled
Returns true if an order is canceled, returns false if it is not.
Learn more
order.cancelled_at
Returns the timestamp of when an order was canceled. Use the date filter to format the timestamp.
Learn more
order.cancel_reason
Returns one of the following cancellation reasons, if an order was canceled: items unavailable fraudulent order customer changed/cancelled order other
Learn more
order.cancel_reason_label
Returns the translated output of an order’s order.cancel_reasonLearn more
Returns an array of discount applications for an order.
Learn more
{% for discount_application in order.discount_applications %}
Discount name: {{ discount_application.title }}
Savings: -{{ discount_application.total_allocated_amount | money }}
{% endfor %}
Discount name: SUMMER19
Savings: -$20.00
order.email
Returns the email address associated with an order.
Learn more
order.financial_status
Returns the financial status of an order. The possible values are: pending authorized paid partially_paid refunded partially_refunded voided
Learn more
order.financial_status_label
Returns the translated output of an order’s financial_status.
Learn more
Returns an array of line items from the order.
Learn more
order.line_items_subtotal_price
Returns the sum of the order's line-item prices after any line item discounts have been applied. The subtotal amount doesn't include cart discounts, taxes (unless taxes are included in the prices), or shipping costs.
Learn more
<!-- subtotal = total dollar value of cart items - line item discount -->
Subtotal: {{ order.line_items_subtotal_price | money }}
<!-- for a cart containing a $500 product with a $50 line item discount -->
Subtotal: $450.00
order.location
POS Only. Returns the physical location of the order. You can configure locations in the Locations settings of the admin.
Learn more
order.order_status_url
Returns the link to the order status page for this order.
Learn more
order.name
Returns the name of the order in the format set in the Standards & formats section of the General Settings of your Shopify admin.
Learn more
{{ order.name }}
\#1025
order.note
Returns the note associated with a customer order.
Learn more
Special instructions: {{ order.note }}
Special instructions: Please deliver after 5 PM
order.order_number
Returns the integer representation of the order name.
Learn more
{{ order.order_number }}
1025
order.phone
Returns the phone number associated with an order, if it exists.
Learn more
order.shipping_address
Returns the shipping address of the order.
Learn more
order.shipping_methods
Returns an array of shipping_method variables from the order.
Learn more
order.shipping_price
Returns the shipping price of an order. Use a money filter to return the value in a monetary format.
Learn more
order.subtotal_line_items
Returns an array of line items that are used to calculate the subtotal_price of an order. Excludes tip line items.
Learn more
order.subtotal_price
Returns the subtotal price of an order. Use a money filter to return the value in a monetary format.
Learn more
order.tags
Returns an array of all of the order's tags. The tags are returned in alphabetical order.
Learn more
{% for tag in order.tags %}
{{ tag }}
{% endfor %}
new
leather
sale
special
order.tax_lines
Returns an array of tax_line variables for an order.
Learn more
Returns the order’s tax price. Use a money filter to return the value in a monetary format.
Learn more
order.total_discounts
Returns the total value of all discounts applied to the order.
Learn more
order.total_net_amount
Returns the net amount of the order.
The order.total_net_amount is calculated after refunds are applied. The value is equivalent to order.total_price minus order.total_refunded_amount.
Learn more
order.total_price
Returns the total price of an order. Use a money filter to return the value in a monetary format.
Learn more
order.total_refunded_amount
Returns the total refunded amount of an order.
Learn more
order.transactions
Returns an array of transactions from the order.
Learn more
Returns the timestamp of when the page was created. Use the date filter to format the timestamp.
Learn more
page.template_suffix
Returns the name of the custom page template assigned to the page, without the page prefix or the .liquid suffix. Returns nil if a custom template is not assigned to the page.
Learn more
<!-- on page.contact.liquid -->
{{ page.template_suffix }}
Returns the meta description of the current page.
Learn more
page_description
The meta description of the current page.The page_description object can be used to provide a brief description of a page for search engine listings and social media previews.
Learn more
page_image
Returns an image drop for the relevant image to be displayed in social media feeds or search engine listings.
Learn more
page_image
Returns an image drop for the relevant image to be displayed in social media feeds or search engine listings.
For product pages, collection pages, and blog posts, the page_image is the resource's featured image if it exists. For example, a product page's page_image is the same as its product.featured_image. If a featured image does not exist, then the page_image is based on the store's social sharing image set in the admin.
Learn more
Returns the page title of the current page. The page_title object can be used to specify the title of page for search engine listings and social media previews.
Learn more
page_title
Returns the page title of the current page.
Learn more
pages
Allows you to access all of the pages on a store.
Learn more
pages
Allows you to access all of the pages on a store. You can access a specific page through the pages object using the page's handle.
Learn more
The paginate tag’s navigation is built using the attributes of the paginate object. You can also use the default_pagination filter for a quicker alternative.
Learn more
paginate.current_page
Returns the number of the current page.
Learn more
paginate.current_offset
Returns the total number of items that are on the pages previous to the current one. For example, if you are paginating by 5 items per page and are on the third page, paginate.current_offset would return 10 (5 items × 2 pages).
Learn more
paginate.items
Returns the total number of items to be paginated. For example, if you are paginating a collection of 120 products, paginate.items would return 120.
Learn more
paginate.parts
Returns an array of all parts of the pagination. A part is a component used to build the navigation for the pagination.
Learn more
paginate.next
Returns the part variable for the Next link in the pagination navigation.
Learn more
Header-value pairs that make up the list of payment information specific to the payment method. This information can be be used by the customer to complete the transaction offline.
Learn more
pending_payment_instruction_input.header
The header of the payment instruction. These are payment method-specific.
Learn more
pending_payment_instruction_input.value
Contains the corresponding values to the headers of the payment instruction.
Learn more
policy
An individual policy of the shop.policies object. An individual policy can also be referenced directly on the shop object. For example shop.privacy_policy.
Learn more
Creates an HTML link element that links to a localied version of shopify.com, based on the locale of the store.
Learn more
powered_by_link
Creates an HTML link element that links to a localied version of shopify.com, based on the locale of the store.
Learn more
{{ powered_by_link }}
<a target="_blank" rel="nofollow" href="https://lanxiaowei.shop?utm_campaign=poweredby&utm_medium=shopify&utm_source=onlinestore">Powered by Shopify</a>
predictive_search
Information about the results from a predictive search query through the Predictive Search API.
Learn more
predictive_search.performed
Returns true when being referenced inside a section that's been rendered using the Predictive Search API and the Section Rendering API. Returns false if not.
Learn more
predictive_search.resources
The resources associated with the search query.
Learn more
Returns true if a product is available for purchase. Returns false if all of the products’ variants inventory_quantity values are zero or less, and their inventory_policy is not set to ‘Allow users to purchase this item, even if it is no longer in stock.’
Learn more
product.collections
Returns an array of all of the collections a product belongs to.
Learn more
{% for collection in product.collections %}
{{ collection.title }}
{% endfor %}
Sale
Shirts
Spring
product.compare_at_price
Returns the lowest compare at price of all the product's variants entered in the Shopify admin. This attribute is similar to product.compare_at_price_min.
If none of the product variants have a value for compare at price, then product.compare_at_price returns nil.
Returns the highest compare at price. Use one of the money filters to return the value in a monetary format.
Learn more
product.compare_at_price_min
Returns the lowest compare at price. Use one of the money filters to return the value in a monetary format.
Learn more
product.compare_at_price_varies
Returns true if the compare_at_price_min is different from the compare_at_price_max. Returns false if they are the same.
Learn more
product.content
Returns the description of the product. Alias for product.description.
Learn more
product.created_at
Returns a timestamp for when a product was created in the admin.
Learn more
{{ product.created_at }}
2019-11-01 05:56:37 -0400
product.description
Returns the description of the product.
Learn more
product.featured_image
Returns the relative URL of the product’s featured image.
Learn more
product.featured_media
Can be used to render the first piece of media attached to the product.
Learn more
product.first_available_variant
Returns the variant object of the first product variant that is available for purchase. In order for a variant to be available, its variant.inventory_quantity must be greater than zero or variant.inventory_policy must be set to continue. A variant with no inventory_policy is considered available.
Learn more
Returns an array of the product’s images. Use the product_img_url filter to link to the product image on Shopify’s Content Delivery Network.
Learn more
{% for image in product.images %}
<img src="{{ image.src | product_img_url: 'medium' }}">
{% endfor %}
Returns an array of a product's associated media objects, sorted by date added.
Learn more
{% for media in product.media %}
{% include 'media' %}
{% endfor %}
product.options
Returns an array of the product’s options.
Learn more
product.options_by_name
Allows direct access to a product's options by their name. The object keys of options_by_name are case-insensitive.
Learn more
<label>
Color
<select>
{% for color_option in product.options_by_name['Color'].values %}
<option>{{ color_option }}</option>
{% endfor %}
</select>
</label>
<label>
Color
<select>
<option>Red</option>
<option>Green</option>
</select>
</label>
product.options_with_values
Returns an array of the product's options.
Learn more
{% for product_option in product.options_with_values %}
<label>
{{ product_option.name }}
<select>
{% for value in product_option.values %}
<option {% if product_option.selected_value == value %}selected{% endif %}>
{{ value }}
</option>
{% endfor %}
</select>
</label>
{% endfor %}
<label>
Color
<select>
<option selected>Red</option>
<option>Green</option>
</select>
</label>
product.price
Returns the price of the product. Use one of the money filters to return the value in a monetary format.
Learn more
product.price_max
Returns the highest price of the product. Use one of the money filters to return the value in a monetary format.
Learn more
product.price_min
Returns the lowest price of the product. Use one of the money filters to return the value in a monetary format.
Learn more
product.price_varies
Returns true if the product’s variants have varying prices. Returns false if all of the product’s variants have the same price.
Learn more
product.published_at
Returns a timestamp for when a product was published on a store.
Learn more
{{ product.published_at }}
2019-11-01 05:56:37 -0400
product.requires_selling_plan
Returns true when all variants of the product have variant.requires_selling_plan set to true.
Learn more
product.selected_variant
Returns the variant object of the currently-selected variant if there is a valid ?variant= parameter in the URL. Returns nil if there is not.
Learn more
{{ product.selected_variant.id }}
124746062
product.selected_or_first_available_variant
Returns the variant object of the currently-selected variant if there is a valid ?variant= query parameter in the URL. If there is no selected variant, the first available variant is returned. In order for a variant to be available, its variant.inventory_quantity must be greater than zero or variant.inventory_policy must be set to continue. A variant with no inventory_management is considered available.
Learn more
Returns a selling_plan_allocation object based on the following sequential logic:
1. If a valid allocation is selected in the URL parameters, then that allocation is returned.
2. If no allocation is specified in the URL, then the first allocation on an in stock variant is returned.
3.If no variants are in stock, then the first allocation on the first variant is returned.
If the product doesn't have selling plans, then this property returns nil.
Returns the selling_plan_allocation object based on URL parameters identifying a selling plan and variant.
For example, when given URL parameters ?variant=12345&selling_plan=8765, the property returns the allocation for the variant object with ID 12345 and the selling plan with ID 8765.
An array of selling_plan_group objects that include the product’s variants.
Learn more
product.tags
Returns an array of all of the product’s tags. The tags are returned in alphabetical order.
Learn more
{% for tag in product.tags %}
{{ tag }}
{% endfor %}
new
leather
sale
special
product.template_suffix
Returns the name of the custom product template assigned to the product, without the product prefix nor the .liquid suffix. Returns nil if a custom template is not assigned to the product.
Learn more
<!-- on product.wholesale.liquid -->
{{ product.template_suffix }}
The product_option object is available for each option in a product options array. The product options array is accessible via product.options_with_values.
Learn more
<ul>
{% for product_option in product.options_with_values %}
<li>{{ product_option.name }}</li>
{% endfor %}
</ul>
<ul>
<li>Color</li>
<li>Size</li>
</ul>
product_option.position
Returns the product option's position in the product options array.
Learn more
<ul>
{% for product_option in product.options_with_values %}
<li>{{ product_option.position }} - {{ product_option.name }}</li>
{% endfor %}
</ul>
<ul>
<li>1 - Color</li>
<li>2 - Size</li>
</ul>
product_option.selected_value
Returns the currently selected value for this product option.
Learn more
<select>
{% for value in product_option.values %}
<option {% if product_option.selected_value == value %}selected{% endif %}>
{{ value }}
</option>
{% endfor %}
</select>
The recommendations object provides product recommendations that are related to a given product, based on data from sales, product descriptions, and relations between products and collections. Product recommendations become more accurate over time as new orders and product data become available. The recommendations object can be used and accessed from any file in your theme.
Learn more
recommendations.performed
Returns true if the recommendations object is referenced inside a theme section that is rendered via /recommendations/products?section_id=&product_id= with valid parameters:
product_id: id of the section where the recommendations object is being used (required) section_id: id of the product you want to show recommended products for yes (required) limit: Limits number of results, up to a maximum of ten no
Learn more
recommendations.products_count
Returns the number of product recommendations, or returns 0 if recommendations.performed is false.
Learn more
recommendations.products
Returns product recommendations. These objects are products. Doesn't return any product if recommendations.performed is false.
Learn more
{% if recommendations.performed %}
{% if recommendations.products_count > 0 %}
{% for product in recommendations.products %}
{{ product.title | link_to: product.url }}
{% endfor %}
{% endif %}
{% else %}
<div class="placeholder">Placeholder animation</div>
{% endif %}
When the enclosing section is rendered synchronously:
Placeholder animation
---------------------
When the enclosing section is rendered from the endpoint /recommendations/products?section_id=<section_id>&product_id=<product_id>:
Product title
Another product title
request
The request object returns information about the domain used to access your store and the page being accessed.
Learn more
request.design_mode
Returns true if the request is being made from the theme editor in the Shopify admin.
Learn more
{% if request.design_mode %}
<!-- This will only render in the theme editor -->
{% endif %}
request.host
You can use request.host to check which domain a customer is visiting from.
Learn more
{{ request.host }}
your-store.myshopify.com
request.locale
Returns the shop_locale of the current request.
Learn more
{{ request.locale.name }}
English
request.origin
Returns the protocol and host of the request.
Learn more
Returns the type of the current page. These are the different page types: 404 article blog cart collection list-collections customers/account customers/activate_account customers/addresses customers/login customers/order customers/register customers/reset_password gift_card index page password product Learn more
Returns true if the request is being made from within the online store editor's visual section preview. Returns false if not.
Learn more
robots
The robots object contains the default rule groups for the robots.txt file.
Learn more
robots.default_groups
Returns a list of group objects for each group of rules.
Learn more
routes
You can use the routes object to generate dynamic URLs to your storefront. By using them instead of hardcoded links, you can make sure your theme supports any changes to the URL format.
Learn more
The rule object returns an individual rule for the robots.txt file, which tells crawlers which pages can, or can't, be accessed. It consists of a directive, which can be either Allow or Disallow, and a value of the associated URL path.
{% if scripts.cart_calculate_line_items %}
<p>Check out our sale: {{ scripts.cart_calculate_line_items.name }}</p>
{% endif %}
Check out our sale: Buy one chambray shirt and get a second for half price
scripts
The active scripts, of each script type, on the store. There can be only one active script of each type. Currently, the only type accessible in Liquid is cart_calculate_line_items.
Learn more
scripts.cart_calculate_line_items
The active line item script. If no line item script is currently active, then nil is returned.
Learn more
Returns true if an HTML form with the attribute action="/search" was submitted successfully. This allows you to show content based on whether a search was performed or not.
Learn more
{% if search.performed %}
<!-- Show search results -->
{% endif %}
search.results
Returns an array of matching search result items. The items in the array can be a(n): product article page
You can access the attributes of the above three objects through search.results.
Learn more
Returns the string that was entered in the search input box. Use the highlight filter to apply a different style to any instances in the search results that match up with search.terms.
Learn more
{{ item.content | highlight: search.terms }}
<!-- If the search term was "Yellow" -->
<strong class="highlight">Yellow</strong> shirts are the best!
search.types
Returns an array of strings representing the types the search was performed on. The items in the array can be any combination of article, page, product.
The search types can be seen in the URL parameters of a search page. For example, storefront.com/search?type=article,product&q=* will have a search.types array containing article and product.
Learn more
section
The section object lets you access a section's properties and setting values.
Learn more
section.blocks
Returns an array of the section's blocks.
Learn more
section.id
For static sections, returns the section's file name without .liquid. For dynamic sections, returns a dynamically generated ID.
Learn more
section.index
The 1-based index of the current section within its location. The index starts at 1 within each location.
Learn more
section.index0
The 0-based index of the current section within its location. This is the same as the index property except that the index starts at 0 instead of 1.
Learn more
section.location
The scope or context of the section, such as a template, section group, or global.
Learn more
section.settings
Returns an object of the section settings set in the theme editor. Retrieve setting values by referencing the setting's unique id.
Learn more
An array of selling_plan_option objects that contain information about the selling plan's value for a particular selling_plan_group_option.
Learn more
{% for option in selling_plan.options %}
{{ option.name }} : {{ option.value }}
{% endfor %}
Delivery frequency : Every month
Payment frequency : Pay per delivery
selling_plan.price_adjustments
An array of selling_plan_price_adjustment objects. A selling_plan_price_adjustment describes how a selling plan changes the price of variants for a given period.
The maximum length of the array is 2. The array is empty when the selling plan doesn't create any price adjustments.
Pay {{ selling_plan_allocation.price_adjustments[0].price | money }} on the first {{ selling_plan.price_adjustments[0].order_count }} orders.
Pay $100.00 on the first 3 orders.
selling_plan.recurring_deliveries
Returns true when the selling plan includes multiple recurring deliveries.
Learn more
selling_plan.selected
Returns true if the selling plan's ID is identified by the selling_plan URL parameter.
Learn more
selling_plan_option
A selling_plan_option object contains the name and values of an individual item in the selling_plan.options array.
Learn more
option.name
Returns the selling plan option’s name.
Learn more
option.position
Returns the index of the the option amongst all the selling_plan.options.
Learn more
option.value
Returns the selling plan option’s value.
Learn more
selling_plan_price_adjustment
Each selling_plan_price_adjustment of the selling plan maps to a selling_plan_allocation_price_adjustment in the selling_plan_allocation array. The selling_plan.price_adjustments describe the intent of the selling plan, while selling_plan_allocation.price_adjustments contains the resulting money amounts.
Learn more
price_adjustment.order_count
The number of orders that this price adjustment applies to.
The value is nil when the price adjustment is applied either on an ongoing basis or for the rest of selling plan's duration.
The 1-based index of the selling_plan_price_adjustment in the selling_plan.price_adjustments array.
Learn more
price_adjustment.value
A float representing the value of price adjustment. The value_type determines what this value actually represents.
Learn more
price_adjustment.value_type
The type of the price adjustment, which can be fixed_amount, percentage, or price.
Learn more
selling_plan_allocation
A selling plan allocation represents how a particular selling plan affects a line item. A selling plan allocation associates a variant with a selling plan.
When a selling plan contains multiple deliveries, such as a 12-month prepaid subscription, the price and compare_at_price values are multiplied by the number of deliveries.
This value is set to the variant’s price without the selling plan applied. If the variant's price with the selling plan applied is the same, then this value is nil.
The price charged for each delivery included in a selling plan.
When a selling plan includes multiple deliveries, the per_delivery_price value will be the selling_plan_allocation.price divided by the number of deliveries.
Each selling_plan_allocation_price_adjustment of the selling plan allocation maps to a selling_plan_price_adjustment in the selling_plan.price_adjustments array. The selling_plan.price_adjustments describes the intent of the selling plan, while selling_plan_allocation.price_adjustments contains the resulting money amounts.
Learn more
price_adjustment.position
The 1-based index of the selling_plan_allocation_price_adjustment in the selling_plan_allocation.price_adjustments array.
Learn more
price_adjustment.price
The price that will be charged for the selling_plan_allocation_price_adjustment period.
Learn more
selling_plan_checkout_charge
Information about how a specific selling plan affects the amount that a customer needs to pay for a line item at checkout.
Learn more
selling_plan_checkout_charge.value
The value of the checkout charge. How this value is interpreted depends on the value type of the checkout charge.
Learn more
A group of selling plans available for some or all of a product's variants. Selling plans in a group all share the same selling_plan_option.name values.
Learn more
selling_plan_group.id
A unique ID for the selling plan group.
Learn more
An array of selling_plan_group_option objects.
Learn more
{% for option in selling_plan_group.options %}
<label>{{ option.name }}</label>
<select>
{% for value in option.values %}
<option {% if value == option.selected_value %}selected{% endif %}>
{{ value }}
</option>
{% endfor %}
</select>
{% endfor %}
Returns true if the selected selling plan is part of the selling plan group. The selected selling plan is based on the URL parameter selling_plan.
Learn more
selling_plan_group.selling_plans
An array of selling_plan objects that belong to the selling_plan_group.
Learn more
selling_plan_group.app_id
An optional string provided by an app to identify selling plan groups created by that app.
If no string is provided by the app, then this property returns nil.
A selling_plan_group_option object contains the name and values of an individual item in the selling_plan_group.options array.
Learn more
option.name
Returns the selling plan option’s name.
Learn more
option.position
Returns the index of the the option amongst all the selling_plan_group.options.
Learn more
option.selected_value
Returns the value for the selling plan group option when a selling_plan_allocation is selected. The selected selling plan allocation is based on both the URL parameters selling_plan and id.
Learn more
option.values
An array of values for the selling plan group option.
Learn more
settings
Allows you to access all of the theme's settings from the settings_schema.json file.
Learn more
settings
Allows you to access all of the theme's settings from the settings_schema.json file.
Learn more
Returns the handle of the shipping method. The price of the shipping rate is appended to the end of the handle.
Learn more
{{ shipping_method.handle }}
shopify-international-shipping-25.00
shipping_method.original_price
Returns the original price of the shipping method before discounts were applied.
Use a money filter to return the value in a monetary format.
Learn more
{{ shipping_method.original_price | money }}
$20.00
shipping_method.price
Returns the price of the shipping method. Use a money filter to return the value in a monetary format.
Learn more
{{ shipping_method.price | money }}
$15
shipping_method.title
Returns the title of the shipping method.
Learn more
{{ shipping_method.title }}
International Shipping
shop
The shop object can be used and accessed from any file in your theme.
Learn more
shop.address
You can add the attributes below to shop.address to return information about a shop’s address.
Learn more
shop.address.city
Returns the city of the shop's address.
Learn more
{{ shop.address.city }}
Ottawa
shop.address.company
Returns the company of the shop's address.
Learn more
{{ shop.address.company }}
Shopify
shop.address.country
Returns the country of the shop's address.
Learn more
{{ shop.address.country }}
Canada
shop.address.country_upper
Returns the country of the shop's address in uppercase.
Learn more
{{ shop.address.country_upper }}
CANADA
shop.address.province
Returns the province or state of the shop's address.
Learn more
{{ shop.address.province }}
Ontario
shop.address.province_code
Returns an abbreviated form of the province or state of the shop's address.
Learn more
Returns an array of accepted credit cards for the shop. Use the payment_type_img_url filter to link to the SVG image file of the credit card.
Learn more
Returns whether or not this is the shop's primary locale.
Learn more
shop_locale.root_url
Returns the root relative URL of the locale.
Learn more
sitemap
The sitemap object returns the sitemap for a specific group in the robots.txt file. The sitemap provides information about the pages and content on a site, and the relationships between them, which helps crawlers crawl a site more efficiently.
The sitemap object consists of a Sitemap directive, and a value of the URL that the sitemap is hosted at.
Returns the URL that the sitemap is hosted at.
Learn more
sort_option
A sort option for a collection or search results page.
Learn more
sort_option.name
The customer-facing name of the sort option. The name can be edited by merchants in the language editor.
Learn more
{{ sort_option.name }}
"Alphabetically, A-Z"
sort_option.value
The value of the sort option. This value is used when assigning the collection.sort_by and search.sort_by parameters.
Learn more
{{ sort_option.name }}
store_availability
The store_availability object is used to show what variants are stocked at physical store locations, regardless of the current stock level. If a location does not stock a variant, then that location will not be returned.
Learn more
Returns the amount of the tax. Use one of the money filters to return the value in a monetary format.
Learn more
{{ tax_line.price | money }}
€25
tax_line.rate
Returns the rate of the tax in decimal notation.
Learn more
{{ tax_line.rate }}
0.14
tax_line.rate_percentage
Returns the rate of the tax in percentage format.
Learn more
{{ tax_line.rate_percentage }}%
14%
template
The template object has a handful of attributes. Referencing just template returns the name of the template used to render the current page, with the .liquid extension omitted. The template object can be used and accessed from any file in your theme.
Learn more
template
As a best practice, it's recommended that you apply the template name as a CSS class on your HTML body tag.
Learn more
<body class="{{ template }}">
<body class="product">
template.directory
Returns the name of the template's parent directory. Returns nil for templates whose parent directory is the templates/ folder.
Learn more
<!-- If you're on the customers/login.liquid template -->
{{ template.directory }}
customers
template.name
Returns the template's name without the template's custom suffix, if it exists, or the .liquid extension.
Learn more
<!-- If you're on the product.alternate.liquid template -->
{{ template.name }}
product
template.suffix
Returns the name of the custom template without the template.name prefix or the .liquid extension. Returns nil if a custom template is not being used.
Learn more
<!-- If you're on the product.alternate.liquid template -->
{{ template.suffix }}
alternate
theme
The theme object contains information about published themes in a shop. You can also use themes to iterate through both themes.
Learn more
theme.id
Returns the theme’s id. This is useful for when you want to link a user directly to the theme’s Customize theme page.
Learn more
theme.role (deprecated)
Returns one of the two possible roles of a theme: main or mobile.
Learn more
Returns the translated output of a transaction’s status.
Learn more
transaction.created_at
Returns the timestamp of when the transaction was created. Use the date filter to format the timestamp.
Learn more
transaction.receipt
Returns text with information from the payment gateway about the payment receipt. This includes whether the payment was a test case and an authorization code if one was included in the transaction.
Learn more
transaction.kind
Returns the type of transaction. There are five transaction types:
authorization is the reserving of money that the customer has agreed to pay.
capture is the transfer of the money that was reserved during the authorization stage.
sale is a combination of authorization and capture, performed in one step.
void is the cancellation of a pending authorization or capture.
refund is the partial or full refund of the captured money to the customer.
Returns the name of the payment gateway used for the transaction.
Learn more
{{ transaction.gateway }}
Cash on Delivery (COD)
transaction.payment_details
The payment_details object contains additional properties related to the payment method used in the transaction. credit_card_company returns the name of the company who issued the customer’s credit card. credit_card_number returns the customer’s credit card number. All but the last four digits are redacted.
Learn more
The gift card used for the transaction. If no gift card was used, then nil is returned.
Learn more
{{ transaction_payment_details.gift_card }}
"nil"
unit_price_measurement
The unit_price_measurement object contains information about how units of a product variant are measured. It's used by the unit_price attribute to calculate unit prices.
Note: Unit prices are only available to stores located in Germany and France.
Returns true if the author is the account owner of the store. Returns false if not.
Learn more
{{ user.account_owner }}
false
user.bio
The bio associated with the author's account. If no bio is specified, then nil is returned.
Learn more
{{ user.bio }}
"Polina got her first cauldron at the tender age of six, and she has been passionate about potions ever since!!"
user.email
The email associated with the author's account.
Learn more
{{ user.email }}
"polinas.potent.potions@gmail.com"
user.first_name
The first name associated with the author's account.
Learn more
{{ user.first_name }}
"Polina"
user.homepage
The URL for the personal website associated with the author's account. If no personal website is specified, then nil is returned.
Learn more
{{ user.homepage }}
null
user.image
The URL for the personal website associated with the author's account. If no personal website is specified, then nil is returned.
Learn more
{{ user.image }}
false
user.last_name
The last name associated with the author's account.
Learn more
{{ user.last_name }}
"Waters"
user.name
The first and last name associated with the author's account.
Learn more
{{ user.name }}
"Polina Waters"
user_agent
The user_agent object returns the user-agent, which is the name of the crawler, for a specific group in the robots.txt file. It consists of a User-agent directive, and a value of the user-agent name.
Returns true if the variant is available to be purchased, or false if it is not. In order for a variant to be available, its variant.inventory_quantity must be greater than zero or variant.inventory_policy must be set to continue. A variant with no variant.inventory_management is also considered available.
Learn more
Returns the image object associated to the variant.
Learn more
{{ variant.image.src }}
products/red-shirt.jpeg
variant.incoming
Returns true if the variant has incoming inventory.
Learn more
variant.inventory_management
Returns the variant’s inventory tracking service.
Learn more
variant.inventory_policy
Returns the string continue if the ‘Allow users to purchase this item, even if it is no longer in stock.’ checkbox is checked in the variant options in the Admin. Returns deny if it is unchecked.
Learn more
variant.next_incoming_date
Returns the date when the next incoming inventory will arrive.
Learn more
variant.inventory_quantity
Returns the variant’s inventory quantity.
Learn more
variant.options
Returns an array of the variant's product option values.
Learn more
{% for option in variant.options %}
- {{ option }}
{% endfor %}
- Red
- Small
- Wool
variant.option1
Returns the value of the variant’s first option.
Learn more
variant.option2
Returns the value of the variant’s second option.
Learn more
variant.option3
Returns the value of the variant’s third option.
Learn more
variant.price
Returns the variant’s price.
Use one of the money filters to return the value in a monetary format.
Returns a selling_plan_allocation object based on the URL parameter selling_plan.
For example, given the URL parameters ?variant=12345&selling_plan=8765, the selling plan allocation for the variant 12345 with a selling plan id of 8765 is returned.
If there is no selected selling plan allocation, then this property returns nil.
Returns the variant’s weight in grams. Use the weight_with_unit filter to convert it to the shop’s weight format or the weight unit configured on the variant.
Learn more
variant.weight_unit
Returns the unit for the weight configured on the variant. Works well paired with the weight_in_unit attribute and the weight_with_unit filter.
Learn more
variant.weight_in_unit
Returns the weight of the product converted to the unit configured on the variant. Works well paired with the weight_unit attribute and the weight_with_unit filter.
Learn more
video
The video object can be accessed from the product object's media attribute. It contains information about a video uploaded from the product details page in the Shopify admin.
Learn more
video.alt
Returns the alt tag of the video set on the product details page of the Shopify admin.
Learn more
video.aspect_ratio
Returns the aspect ratio of the video source file.
Learn more
video.duration
Returns the duration of the video source file.
Learn more
Returns an array of video_source objects.
Learn more
video_source
The video_source object can be accessed from the video object's sources array. The video_source object contains information about the source files for a video associated with a product.
Learn more
video_source.format
Returns the format of the video source file (mp4/m3u8).
Learn more
video_source.height
Returns the height of the video source file.
Learn more
{% comment %}
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. Learn more