Shopify Cheat Sheet — A resource for building Shopify Themes with Liquid

的Shopify Cheat Sheet is a resource for building Shopify Themes with Liquid

What is Liquid?

Tools

Reference

的Shopify Cheat Sheet is a resource for building Shopify Themes with Liquid

What is Liquid?

You have no categories selected.

Handles

的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?

的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

 {{ 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 asifandunless.Learn more

==

equalsLearn more

{% if product.title == 'Awesome Shoes' %} These shoes are awesome! {% endif %}

!=

does not equalLearn more

>

greater thanLearn more

<

less thanLearn more

>=

greater than or equal toLearn more

<=

less than or equal toLearn more

or

condition A or condition BLearn more

and

condition A and condition BLearn more

contains

checks for the presence of a substring inside a string or arrayLearn 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 theassignorcapturetags.Learn more

Strings

Strings are declared by wrapping the variable’s value in single or double quotes.Learn more

{% assign my_string = 'Hello World!' %}

Numbers

Numbers include floats and integers.Learn more

{% assign my_num = 25 %}

Booleans

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 afortag or atablerow标签。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 anifstatement.Learn more

What is truthy?

所有值在液体真相,例外n ofnilandfalse. In this example, the variable is a string type but it evaluates astrue.Learn more

{% assign tobi = 'tobi' %} {% if tobi %} This will always be true. {% endif %}

What is falsy?

的only values that are falsy in Liquid arenilandfalse.nilis returned when a Liquid object doesn’t have anything to return. For example, if a collection doesn’t have a collection image,collection.imagewill be set tonil.Learn more

{% if collection.image %}  {% endif %}

Whitespace Control

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, theassignstatement doesn't output a blank line.Learn more

{%- assign my_variable = "tomato" -%} {{ my_variable }}
tomato

Control Flow Tags

Control Flow Tags determine which block of code should be 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 %}
这些shoes are awesome!

{% elsif %} / {% else %}

Adds more conditions within aniforunlessblock.Learn more

 {% 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.caseinitializes the switch statement andwhencompares 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 toif, 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 %}
这些shoes are not awesome.

{% and %}

andoperator lets you add additional conditions to a tag. A condition that usesandwill only be true if both the left and the right side of the condition are true.Learn more

{% if product.title == 'Awesome Shoes' and product.price < 20000 %} These awesome shoes are affordable. {% endif %}
这些awesome shoes are affordable.

{% or %}

oroperator lets you add additional conditions to a tag. A condition with anorwill be true if either the left or the right side of the condition is true.Learn more

{% if product.title == 'Awesome Shoes' or product.title == 'Awesome Hat' %} You're buying an awesome product! {% endif %}
You're buying an awesome product!

Iteration Tags

Iteration Tags are used to run a block of code repeatedly.Learn more

{% for %}

Repeatedly executes a block of code.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

{% cycle 'one', 'two', 'three' %} {% cycle 'one', 'two', 'three' %} {% cycle 'one', 'two', 'three' %} {% cycle 'one', 'two', 'three' %}
one two three one

{% tablerow %}

Generates an HTML. Must be wrapped in an opening
and closing
HTML tags.Learn more

 {% tablerow product in collection.products %} {{ product.title }} {% endtablerow %} 
Cool Shirt Alien Poster Batman Poster Bullseye Shirt Another Classic Vinyl Awesome Jeans

的me Tags

的me 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

{% comment %}

Allows you to leave un-rendered code inside a Liquid template. Any text within the opening and closing comment blocks will not be output, and any Liquid code within will not be executed.Learn more

My name is {% comment %}super{% endcomment %} Shopify.
My name is Shopify.

{% echo %}

Works inside theliquidtag to output an expression, or Liquid object, in the rendered HTML. Filters can also be applied to expressions that use theecho标签。Learn more

{% liquid if product.featured_image echo product.featured_image | img_tag else echo 'product-1' | placeholder_svg_tag endif %}
Red Shirt Small

{% include %}

Inserts a snippet from the snippets folder of a theme.Learn more

{% form %}

Creates an HTML

element with all the necessary attributes (action, id, etc.) andto submit the form successfully.Learn more

{% liquid %}

Allows you to write multiple tags within one set of delimiters. This reduces the requirement to open and close multiple sets of delimiters when creating variables and conditions, or executing blocks of code.Learn more

{% liquid case section.blocks.size when 1 assign column_size = '' when 2 assign column_size = 'one-half' when 3 assign column_size = 'one-third' else assign column_size = 'one-quarter' endcase %}

{% paginate %}

paginatetag works in conjunction with thefortag to split content into numerous pages. It must wrap afortag block that loops through an array.Learn more

{% raw %}

Allows output of Liquid code on a page without being parsed.Learn more

{% raw %}{{ 5 | plus: 6 }}{% endraw %} is equal to 11.
{{ 5 | plus: 6 }} is equal to 11.

{% 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' %}

{% style %}

的Liquid{% style %}tag renders an HTML

Variable Tags

Variable Tags are used to create new Liquid variables.Learn more

{% assign %}

Creates a new variable.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

{% increment variable %} {{ variable }} {% increment variable %} {{ variable }} {% increment variable %} {{ variable }}
0 1 2

{% decrement %}

Creates a new number variable and decreases its value by one every time it is called. The initial value is -1.Learn more

{% decrement variable %} {{ variable }} {% decrement variable %} {{ variable }} {% decrement variable %} {{ variable }}
-1 -2 -3

Additional Filters

General filters serve many different purposes including formatting, converting, and applying CSS classes.Learn more

date

Converts a timestamp into another date format.Learn more

{{ article.published_at | date: "%a, %b %d, %y" }}
Tue, Apr 22, 14

default

Sets a default value for any variable with no assigned value. Can be used with strings, arrays, and hashes. The default value is returned if the variable resolves tonilor an empty string"". A string containing whitespace characters will not resolve to the default value.Learn more

Dear {{ customer.name | default: "customer" }}
 Dear customer  Dear customer  Dear

default_errors

Outputs default error messages for theform.errorsvariable. The messages returned are dependent on the strings returned byform.errors.Learn more

{% if form.errors %} {{ form.errors | default_errors }} {% endif %}
 Please enter a valid email address.

default_pagination

Creates a set of links for paginated results. Used in conjunction with the paginate variable.Learn more

{{ paginate | default_pagination }}
1 2 3  17 Next »

format_address

Use theformat_addressfilter on an address to print the elements of the address in order according to their locale. The filter will only print the parts of the address that have been provided. This filter works on the addresses page for customers who have accounts in your store, or on your store's address.Learn more

{{ address | format_address }}

Elizabeth Gonzalez
1507 Wayside Lane
San Francisco
CA
94103
United States

highlight

Wraps words inside search results with an HTMLtag with the classhighlightif it matches the submitted search terms.Learn more

{{ item.content | highlight: search.terms }}
 Yellow shirts are the best!

highlight_active

Wraps a tag link in awith the classactiveif that tag is being used to filter a collection.Learn more

 {% for tag in collection.tags %} {{ tag | highlight_active | link_to_tag: tag }} {% endfor %}
Cotton Crew Neck Jersey

json

Converts a string into JSON format.Learn more

var content = {{ pages.page-handle.content | json }};
var content = "\u003Cp\u003E\u003Cstrong\u003EYou made it! Congratulations on starting your own e-commerce store!\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EThis is your shop\u0026#8217;s \u003Cstrong\u003Efrontpage\u003C/strong\u003E, and it\u0026#8217;s the first thing your customers will see when they arrive. You\u0026#8217;ll be able to organize and style this page however you like.\u003C/p\u003E\n\u003Cp\u003E\u003Cstrong\u003ETo get started adding products to your shop, head over to the \u003Ca href=\"/admin\"\u003EAdmin Area\u003C/a\u003E.\u003C/strong\u003E\u003C/p\u003E\n\u003Cp\u003EEnjoy the software, \u003Cbr /\u003E\nYour Shopify Team.\u003C/p\u003E";

placeholder_svg_tag

Takes a placeholder name and outputs a placeholder SVG illustration. An optional argument can be supplied to include a custom class attribute on the SVG tag.Learn more

{{ 'collection-1' | placeholder_svg_tag }}
 ... 

t (translation)

tfilter uses a translation key to access the locale file for the active language and returns the corresponding string of translated text in the locale file.Learn more

{{ 'products.product.sold_out' | t }}
Sold out

weight_with_unit

格式的产品变体weight.Learn more

{{ product.variants.first.weight | weight_with_unit }}
24.0 kg

Array Filters

Array filters are used to modify the output of arrays.Learn more

concat

Concatenates (combines) an array with another array. The resulting array contains all the elements of the original arrays.Learn more

{% assign fruits = "apples, oranges" | split: ", " %} {% assign vegetables = "broccoli, carrots" | split: ", " %} {% assign plants = fruits | concat: vegetables %} {{ plants | join: ", " }}
apples, oranges, brocolli, carrots

join

Joins the elements of an array with the character passed as the parameter. The result is a single string.Learn more

{{ product.tags | join: ', ' }}
tag1, tag2, tag3

first

Returns the first element of an array.Learn more

 {{ product.tags | first }}
sale

index

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

 {{ product.tags[2] }}
womens

last

Gets the last element in an array.Learn more

 {{ product.tags | last }}
awesome

map

Accepts an array element’s attribute as a parameter and creates a string out of each array element’s value.Learn more

 {{ collections | map: 'title' }}
SpringSummer

reverse

Reverses the order of the items in an array.Learn more

{% assign my_array = "a, b, c, d" | split: ", " %} {{ my_array | reverse | join: ", " }}
d, c, b, a

size

Returns the length of a string or an array.Learn more

{{ 'is this a 30 character string?' | size }}
30

sort

Sorts the elements of an array by a given attribute.Learn more

 {% assign products = collection.products | sort: 'title' %} {% for product in products %} {{ product.title }} {% endfor %}
A B a b

uniq

Removes any duplicate instances of elements in an array.Learn more

{% assign fruits = "orange apple banana apple orange" %} {{ fruits | split: ' ' | uniq | join: ' ' }}
orange apple banana

where

Creates an array including only the objects with a given property value, or any truthy value by default.Learn more

All products: {% for product in collection.products %} - {{ product.title }} {% endfor %} {% assign kitchen_products = collection.products | where: "type", "kitchen" %} Kitchen products: {% for product in kitchen_products %} - {{ product.title }} {% endfor %}
All products: - Vacuum - Spatula - Television - Garlic press Kitchen products: - Spatula - Garlic press

Color Filters

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

{{ '#fff00f' | brightness_difference: '#0b72ab' }}
129

color_brightness

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 inrgba()format, even if your input color was in hex format.Learn more

{{ '#7ab55c' | color_modify: 'red', 255 }} {{ '#7ab55c' | color_modify: 'alpha', 0.85 }}
#ffb55c rgba(122, 181, 92, 0.85)

color_saturate

Saturates the input color. Takes a value between 0 and 100 percent.Learn more

{{ '#7ab55c' | color_saturate: 30 }}
#6ed938

color_to_rgb

Converts a CSS color string to CSSrgb()format. If the input color has an alpha component, then the output will be in CSSrgba()format.Learn more

{{ '#7ab55c' | color_to_rgb }} {{ 'hsla(100, 38%, 54%, 0.5)' | color_to_rgb }}
rgb(122, 181, 92) rgba(122, 181, 92, 0.5)

color_to_hsl

Converts a CSS color string to CSShsl()format. If the input color has an alpha component, then the output will be in CSShsla()format.Learn more

{{ '#7ab55c' | color_to_hsl }} {{ 'rgba(122, 181, 92, 0.5)' | color_to_hsl }}
hsl(100, 38%, 54%) hsla(100, 38%, 54%, 0.5)

color_to_hex

Converts a CSS color string tohex6format. Hex output is always inhex6format. If there is an alpha channel in the input color, it will not appear in the output.Learn more

{{ 'rgb(122, 181, 92)' | color_to_hex }} {{ 'rgba(122, 181, 92, 0.5)' | color_to_hex }}
#7ab55c #7ab55c

Font Filters

Font filters are called onfontobjects. You can use font filters to load fonts or to obtain font variants.Learn more

font_face

Returns a CSS@font-facedeclaration to load the chosen font.Learn more

font_modify

font_modifytakes 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 usingfont.variants, you can more easily access specific styles and weights by using the font_modify filter.Learn more

{% assign bold_font = settings.body_font | font_modify: 'weight', 'bold' %} h2 { font-weight: {{ bolder_font.weight }}; }
h2 { font-weight: 900; }

font_url

Returns a CDN URL for the chosen font. By default,font_urlreturns 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

{{ settings.type_header_font | font_url }} {{ settings.type_base_font | font_url: 'woff' }}
https://fonts.shopifycdn.com/neue_haas_unica/neuehaasunica_n4.8a2375506d3dfc7b1867f78ca489e62638136be6.woff2?...9waWZ5Lmlv https://fonts.shopifycdn.com/work_sans/worksans_n6.399ae4c4dd52d38e3f3214ec0cc9c61a0a67ea08.woff?...b63d5ca77de58c7a23ece904

HTML Filters

HTML filters wrap assets in HTML tags.Learn more

currency_selector

Generates a drop-down list that customers can use to select an accepted currency on your storefront. This filter must be used on theformobject within a currency form.Learn more

{% form 'currency' %} {{ form | currency_selector: class: 'my_special_class', id: 'Submit' }} {% endform %}

img_tag

Generates an image tag.Learn more

{{ 'smirking_gnome.gif' | asset_url | img_tag }}

payment_button

Creates a dynamic checkout button for a product. This filter must be used on the form object within a product form.Learn more

{{ form | payment_button }}
...

payment_terms

Renders the Shop Pay Installments banner for a product. This filter must be used on the form object within a product form.Learn more

{{ form | payment_terms }}
 ... 

payment_type_svg_tag

Returns the标签inlini请求支付类型的图像ng purposes. Used in conjunction with theshop.enabled_payment_types variableLearn more

{% for type in shop.enabled_payment_types %} {{ type | payment_type_svg_tag, class: 'custom-class' }} {% endfor %}
    ... 

script_tag

Generates a script tag.Learn more

{{ 'shop.js' | asset_url | script_tag }}

stylesheet_tag

Generates a link tag that points to the given stylesheet.Learn more

{{ 'shop.css' | asset_url | stylesheet_tag }}

time_tag

time_tagfilter converts a timestamp into an HTML标签。的output format can be customized by passing date parameters to thetime_tagfilter.Learn more

{{ article.published_at | time_tag }} {{ article.published_at | time_tag: '%a, %b %d, %Y' }}
 

Math Filters

Math filters can be linked and are applied in order from left to right, as with all other filtersLearn more

abs

Returns the absolute value of a number or string that onnly contains a number.Learn more

{{ -24 | abs }} {{ "-1.23" | abs }}
24 1.23

at_least

Limits a number to a minimum value.Learn more

{{ 2 | at_least: 5 }} {{ 2 | at_least: 1 }}
5 2

at_most

Limits a number to a maximum value.Learn more

{{ 2 | at_most: 5 }} {{ 2 | at_most: 1 }}
2 1

ceil

Rounds an output up to the nearest integer.Learn more

{{ 4.6 | ceil }} {{ 4.3 | ceil }}
5 5

divided_by

Divides an output by a number. The output is rounded down to the nearest integer.Learn more

 {{ product.price | divided_by: 10 }}
20

floor

Rounds an output down to the nearest integer.Learn more

{{ 4.6 | floor }} {{ 4.3 | floor }}
4 4

minus

Subtracts a number from an input.Learn more

 {{ product.price | minus: 15 }}
185

plus

Adds a number to an output.Learn more

 {{ product.price | plus: 15 }}
215

round

Rounds the output to the nearest integer or specified number of decimals.Learn more

{{ 4.6 | round }} {{ 4.3 | round }} {{ 4.5612 | round: 2 }}
5 4 4.56

times

Multiplies an output by a number.Learn more

 {{ product.price | times: 1.15 }}
230

modulo

Divides an output by a number and returns the remainder.Learn more

{{ 12 | modulo:5 }}
2

Media Filters

Media filters let you generate URLs for a product's media.Learn more

external_video_tag

Generates an IFrame that contains a YouTube video player.Learn more

{% if product.featured_media.media_type == "external_video" %} {{ product.featured_media | external_video_tag }} {% endif %}

external_video_url

Used to set parameters for the YouTube player rendered by external_video_tag.Learn more

{% if product.featured_media.media_type == "external_video" %} {{ product.featured_media | external_video_url: color: "white" | external_video_tag }} {% endif %}

img_tag

When used with a model or a video object, theimg_tagfilter generates an image tag for the media's preview image.Learn more

{% if product.featured_media.media_type == "model" %} {{ product.featured_media | img_tag }} {% endif %}
< img src = " / / cdn.shopify.com/s/files/1/1425/8696/products/b15ddb43cbac45b1ae2685223fa3536d_small.jpg?v=1560284062">

img_url

When used with a media object, theimg_urlfilter generates an image URL for the media's preview image.Learn more

{% if product.featured_media.media_type == "video" %} {{ product.featured_media | img_url: '500x500' }} {{ product.featured_media | img_url }} {% endif %}
//cdn.shopify.com/s/files/1/1425/8696/products/b15ddb43cbac45b1ae2685223fa3536d_500x500.jpg?v=1560284062 //cdn.shopify.com/s/files/1/1425/8696/products/b15ddb43cbac45b1ae2685223fa3536d_small.jpg?v=1560284062

media_tag

Generates an appropriate tag for the media.Learn more

{% if product.featured_media.media_type == "model" %} {{ product.featured_media | media_tag }} {% endif %}
 ... 

model_viewer_tag

Generates a Google model viewer component tag for the given 3D model.Learn more

{% if product.featured_media.media_type == "model" %} {{ product.featured_media | model_viewer_tag }} {% endif %}
 ... 

video_tag

Generates a video tag.Learn more

{% if product.featured_media.media_type == "video" %} {{ product.featured_media | video_tag }} {% endif %}
<视频playsinline = " true "控制= " " > < src来源="https://videos.shopifycdn.com/c/vp/afe4b8a92ca944e49bc4b888927b7ec3/master.m3u8?Expires=1560458164&KeyName=core-signing-key-1&Signature=BIQQpuyEVnyt9HUw4o9QOmQ1z2c=" type="application/x-mpegURL">   

Sorry html5 video is not supported in this browser

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

{{product.metafields.instructions.wash | metafield_tag }}
 This is a single line of text.

metafield_text

Generates a text version of the metafield data.Learn more

{{product.metafields.instructions.wash | metafield_text }}

Money Filters

Money filters format prices based on the Currency Formatting found in General Settings.Learn more

money

Formats the price based on the shop’s ‘HTML without currency’ setting.Learn more

{{ 145 | money }}
 $1.45  $1

money_with_currency

Formats the price based on the shop’s ‘HTML with currency’ setting.Learn more

{{ 1.45 | money_with_currency }}
 $1.45 CAD

money_without_trailing_zeros

Formats the price based on the shop’s ‘HTML with currency’ setting and excludes the decimal point and trailing zeros.Learn more

 {{ 20.00 | money_without_trailing_zeros }}
$20

money_without_currency

Formats the price using a decimal.Learn more

{{ 1.45 | money_without_currency }}
1.45

String Filters

String filters are used to manipulate outputs and variables of the string type.Learn more

append

Appends characters to a string.Learn more

{{ 'sales' | append: '.jpg' }}
sales.jpg

camelcase

Converts a dash-separated string into CamelCase.Learn more

{{ 'coming-soon' | camelcase }}
ComingSoon

capitalize

Capitalizes the first word in a string.Learn more

{{ 'capitalize me' | capitalize }}
Capitalize me

downcase

Converts a string into lowercase.Learn more

{{ 'UPPERCASE' | downcase }}
uppercase

escape

Escapes a string.Learn more

{{ "

test

" | escape }}

test

handleize

Formats a string into a handle.Learn more

{{ '100% M & Ms!!!' | handleize }}
100-m-ms

hmac_sha1

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

{%分配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

{%分配my_secret_string = " ShopifyIsAwesome !”|hmac_sha256: "secret_key" %} My encoded string is: {{ my_secret_string }}
My encoded string is: 30ab3459e46e7b209b45dba8378fcbba67297304

md5

Converts a string into an MD5 hash.Learn more

newline_to_br

Inserts a
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
Two
Three

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

{{ cart.item_count | pluralize: 'item', 'items' }}
3 items

prepend

Prepends characters to a string.Learn more

{{ 'sale' | prepend: 'Made a great ' }}
Made a great sale

remove

Removes all occurrences of a substring from a string.Learn more

{{ "Hello, world. Goodbye, world." | remove: "world" }}
Hello, . Goodbye, .

remove_first

Removes only the first occurrence of a substring from a string.Learn more

{{ "Hello, world. Goodbye, world." | remove_first: "world" }}
Hello, . Goodbye, world.

replace

Replaces all occurrences of a substring with a string.Learn more

 {{ product.title | replace: 'Awesome', 'Mega' }}
Mega Shoes

replace_first

Replaces the first occurrence of a substring with a string.Learn more

 {{ product.title | replace_first: 'Awesome', 'Mega' }}
Mega Awesome Shoes

slice

的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

{{ "hello" | slice: 0 }} {{ "hello" | slice: 1 }} {{ "hello" | slice: 1, 3 }}
h e ell

split

的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 }}"
 "too many spaces "

reverse

reversecannot 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

{{ ' too many spaces ' | rstrip }}
" too many spaces"

sha1

Converts a string into a SHA-1 hash.Learn more

{%分配my_secret_string = " ShopifyIsAwesome !”|sha1 %} My encoded string is: {{ my_secret_string }}
My encoded string is: c7322e3812d3da7bc621300ca1797517c34f63b6

sha256

Converts a string into a SHA-256 hash.Learn more

{%分配my_secret_string = " ShopifyIsAwesome !”|sha256 %} My encoded string is: {{ my_secret_string }}
My encoded string is: c29cce758876791f34b8a1543f0ec3f8e886b5271004d473cfe75ac3148463cb

strip_html

Strips all HTML tags from a string.Learn more

{{ "

Hello

World" | strip_html }}
Hello World

strip_newlines

Removes any line breaks/newlines from a string.Learn more

 {% for tag in collection.tags %} {{ tag | link_to_tag: tag }} {% endfor %}
Mens Womens Sale

payment_type_img_url

Returns the URL of the payment type’s SVG image. Used in conjunction with theshop.enabled_payment_typesvariable.Learn more

{% for type in shop.enabled_payment_types %}  {% endfor %}
   

shopify_asset_url

Returns the URL of a global assets that are found on Shopify’s servers.Learn more

{{ 'option_selection.js' | shopify_asset_url | script_tag }}

sort_by

Creates a URL to a collection page with the providedsort_byparameter. This filter must be applied to a collection URL.Learn more

{{ collection.url | sort_by: 'best-selling' }}
/collections/widgets?sort_by=best-selling

url_for_type

Creates a URL that links to a collection page containing products with a specific product type.Learn more

{{ "T-shirt" | url_for_type }}
collections/types?q=T-shirt

url_for_vendor

Creates a URL that links to a collection page containing products with a specific product vendor.Learn more

{{ "Shopify" | url_for_vendor }}
/collections/vendors?q=Shopify

within

Creates a collection-aware product URL by prepending/collections/collection-handleto a product URL, wherecollection-handleis the handle of the collection that is currently being viewed.Learn more

{{ product.title }}
Alien Poster

Global Objects

这些objects can be used and accessed fromany filein your theme, and are defined asglobal objects, or global variables.Learn more

all_products

Returns a list of all the products in your store. You can useall_productsto access products by their handles.Learn more

{{ all_products['fancy-shoes'].title }}
Fancy Shoes

articles

Returns a list of all the blog articles in a store.Learn more

{% assign article = articles['news/new-products'] %} {{ article.title | link_to: article.url }}
New products

blogs

Returns a list of all the blogs in a store.Learn more

{% for blog in blogs %} {{ blog.title }} {% endfor %}
News Product updates Events

canonical_url

Returns the canonical URL of the current page. A page's canonical URL is the page's default URL without any URL parameters. For products and variants, the canonical URL is the default product page with no collection or variant selected.Learn more

{{ canonical_url }}

collections

Returns a list of all of the collections in a store.Learn more

{% for collection in collections %} {{ collection.title }} {% endfor %}
Fall collection Best sellers New products

current_page

current_pagereturns the number of the page you are on when browsing through paginated content. It can be used outside the paginate block.Learn more

{{ page_title }} - Page: {{ current_page }}
Summer Collection - Page: 1

handle

返回的处理page that is being viewed.Learn more

{% if handle contains 'hide-from-search' %}  {% endif %}

images

Allows you to access any image in a store by its filename.Learn more

{% assign image = images['store-logo.png'] %} {{ image.alt }}

linklists

Returns a list of all the menus (link lists) in your store. You can uselinkliststo access your link lists with their handles.Learn more

    {% for link in linklists.main-menu.links %}
  • {{ link.title | link_to: link.url }}
  • {% endfor %}

page_description

Returns the description of the product, collection, or page that is being viewed. You can set descriptions in the Shopify admin.Learn more

{{ page_description }}
All about my store.

page_title

Returns the title of the product, collection, or page that is being viewed. You can set titles in the Shopify admin.Learn more

{{ page_title }}
About us

pages

Returns a list of all the pages in your store. You can usepagesto access your pages with their handles.Learn more

{{ pages.about.title }}

By {{ pages.about.author }}

{{ pages.about.content }}

About us

By Anne Teak

About page content!

request

Returns information about the domain used to access the store. Userequest.hostto check which domain a customer is visiting from.Learn more

{%如果请求。主机= = ' myshop.com ' %}欢迎美国!{% elsif request.host == 'myshop.ca' %} Welcome Canada! {% else %} Welcome! {% end %}

scripts

Returns information about a store's active scripts. To learn more about Shopify Scripts, visit the help content for theScript Editor appor theScripts API.Learn more

{% if scripts.cart_calculate_line_items %} 

We are running a {{ scripts.cart_calculate_line_items.name }} promotion!

{% endif %}

settings

Returns a list of the settings in your published theme.Learn more

{% if settings.use_logo %} {{ 'logo.png' | asset_url | img_tag: shop.name }} {% else %}  {% endif %}

address

addressobject 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 theaddressobject, you must specify which address you want to target. This is done by using eithershipping_addressorbilling_addressbefore 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

的all_country_option_tags object creates anoptiontag for each country. An attribute called data-provinces is set for eachoption, 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

的all_country_option_tags object should be wrapped inselecttags.Learn more

article

articleobject.Learn more

article.author

Returns the full name of the article’s author.Learn more

article.comments

Returns the published comments of an article. Returns an empty array if comments are disabled.Learn more

article.comments_count

Returns the number of published comments for an article.Learn more

article.comments_enabled?

Returnstrueif comments are enabled. Returnsfalseif comments are disabled.Learn more

article.comment_post_url

Returns the relative URL where POST requests are sent to when creating new comments.Learn more

article.content

Returns the content of an article.Learn more

article.created_at

Returns the timestamp of when an article was created. Use thedatefilter to format the timestamp.Learn more

{{ article.created_at | date: "%a, %b %d, %y" }}
Fri, Sep 16, 11

article.excerpt

Returns the excerpt of an article.Learn more

article.excerpt_or_content

Returnsarticle.excerptof the article if it exists. Returnsarticle.contentif an excerpt does not exist for the article.Learn more

article.handle

返回的处理article.Learn more

article.id

Returns the id of an article.Learn more

article.image

Returns the article image. Use theimg_urlfilter to link it to the image file on the Shopify CDN. Check for the presence of the image first.Learn more

{% if article.image %} {{ article | img_url: 'medium' }} {% endif %}

article.image.alt

Returns the article image'salttext.Learn more

article.image.src

Returns the relative URL to the article image.Learn more

{{ article.image.src | img_url: 'medium' }}

article.moderated?

Returnstrue如果博客文章属于设置moderate comments. Returnsfalseif the blog is not moderated.Learn more

article.published_at

Returns the date/time when an article was published. Use thedatefilter to format the timestamp.Learn more

article.tags

Returns all the tags for an article.Learn more

{% for tag in article.tags %} {{ tag }} {% endfor %}

article.updated_at

Returns returns a timestamp for when a blog article was updated. Thedatefilter 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

article.user.account_owner

Returnstrueif the author of the article is the account owner of the shop. Returnsfalseif the author is not the account owner.Learn more

article.user.bio

Returns the bio of the author of an article. This is entered through the Staff members options on the Account page.Learn more

article.user.email

Returns the email of the author of an article. This is entered through the Staff members options on the Account page.Learn more

article.user.first_name

Returns the first name of the author of an article. This is entered through the Staff members options on the Account page.Learn more

article.user.homepage

返回一篇文章的作者的主页。This is entered through the Staff members options on the Account page.Learn more

article.user.image

Returns the image object of the author of the article.Learn more

{% if article.user.image %} {{ article.user.image | img_url: '200x200' }} {% endif %}
//cdn.shopify.com/s/files/1/0087/0462/users/user-image_200x200.png?v=1337103726

article.user.last_name

返回一篇文章的作者的姓。This is entered through the Staff members options on the Account page.Learn more

block

Ablockrepresents the content and settings of a single block in an array of section blocks. Theblockobject can be accessed in a section file by looping throughsection.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 uniqueid.Learn more

block.shopify_attributes

Returns a string representing the block's attributes. The theme editor's JavaScript API uses a block'sshopify_attributesto identify blocks and listen for events. No value forblock.shopify_attributesis 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 theblock.type.Learn more

blog

blogobject.Learn more

blog.all_tags

Returns all tags of all articles of a blog. This includes tags of articles that are not in the current pagination view.Learn more

{% for tag in blog.all_tags %} {{ tag }} {% endfor %}

blog.articles

Returns an array of all articles in a blog.Learn more

{% for article in blog.articles %} 

{{ article.title }}

{% endfor %}

blog.articles_count

Returns the total number of articles in a blog. This total does not include hidden articles.Learn more

blog.comments_enabled?

Returnstrueif comments are enabled. Returnsfalseif comments are disabled.Learn more

blog.handle

返回的处理blog.Learn more

blog.id

Returns the id of the blog.Learn more

blog.moderated?

Returnstrueif comments are moderated, orfalseif they are not moderated.Learn more

blog.next_article

Returns the URL of the next (older) post. Returnsfalseif there is no next article.Learn more

blog.previous_article

Returns the URL of the previous (newer) post. Returnsfalseif there is no next article.Learn more

blog.tags

Returns all tags in a blog. Similar to all_tags, but only returns tags of articles that are in the filtered view.Learn more

blog.title

Returns the title of the blog.Learn more

blog.url

Returns the relative URL of the blog.Learn more

cart

cartobject can be used and accessed fromany filein your theme.Learn more

cart.attributes

cart.attributesallow 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 thecart.currencyis 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

{{ cart.item_count }} {{ cart.item_count | pluralize: 'Item', 'Items' }} ({{ cart.total_price | money }})
25 items ($53.00)

cart.items

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.noteallows 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 theweight_with_unitfilter to format the weight.Learn more

checkout

checkoutobject can be accessed in the order status page of the checkout. Shopify Plus merchants can also access properties of thecheckoutobject in thecheckout.liquidlayout 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 ofdiscounts_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

checkout.id

Returns the id of the checkout.Learn more

checkout.line_items

Returns all the line items of the checkout.Learn more

checkout.name

Returns the name of the checkout. This value is identical tocheckout.idwith a hash prepended to it.Learn more

checkout.note

Returns the note of the checkout.Learn more

checkout.order

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 benil.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

collection

collectionobject.Learn more

collection.all_products_count

Returns the number of products in a collection.collection.all_products_countwill 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_tagswill return the full list of tags even when the collection view is filtered.collection.all_tagswill 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 %}
Accessories Chairs Shoes

collection.all_vendors

Returns a list of all product vendors in a collection.Learn more

{% for product_vendor in collection.all_vendors %} {{ product_vendor | link_to_vendor }} {% endfor %}
Shopify Shirt Company Montezuma

collection.current_type

Returns the product type on a/collections/types?q=TYPE收藏页面。例如,您可能在非盟tomatic 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收藏页面。例如,您可能在非盟tomatic 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.filters

Returns an array of filter objects that have been set up on the collection.Learn more

collection.handle

Returns the handle of a collection.Learn more

collection.id

Returns the id of a collection.Learn more

collection.image

Returns the collection image. Use theimg_urlfilter to link it to the image file on the Shopify CDN. Check for the presence of the image first.Learn more

{% if collection.image %} {{ collection.image | img_url: 'medium' }} {% endif %}

collection.next_product

Returns the URL of the next product in the collection. Returnsnilif 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. Returnsnilif 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

{{ collection.all_products_count }} {{ collection.all_products_count | pluralize: 'Item', 'Items' }} total
24 Items

collection.published_at

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 theSet publish datecalendar 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 thesort_byURL parameter. When there is nosort_byURL parameter, the value isnull(e.g. /collections/widgets?sort_by=best-selling).Learn more

{% if collection.sort_by %} Sort by: {{ collection.sort_by }} {% endif %}
Sort by: best-selling

collection.sort_options

Returns an array of sorting options for the collection.Learn more

<选择name = " sort_by " >{%选项的馆藏n.sort_options %}  {% endfor %} 

collection.template_suffix

Returns the name of the custom collection template assigned to the collection, without the collection prefix or the .liquid suffix. Returnsnilif a custom template is not assigned to the collection.Learn more

{{ collection.template_suffix }}
no-price

collection.title

Returns the title of the collection.Learn more

{{ collection.title }}

Frontpage

collection.tags

Returns all tags of all products in a collection.Learn more

collection.url

Returns the URL of the collection.Learn more

color

colorobject is returned from color type settings, and has the following attributes.Learn more

alpha

Returns the alpha component of the color, which is a decimal number between 0 and 1.Learn more

blue

Returns the blue component of the color, which is a number between 0 and 255.Learn more

green

Returns the green component of the color, which is a number between 0 and 255.Learn more

hue

Returns the hue component of the color, which is a number between 0 and 360.Learn more

lightness

Returns the lightness component of the color, which is a number between 0 and 100.Learn more

red

Returns the red component of the color, which is a number between 0 and 255.Learn more

saturation

Returns the saturation component of the color, which is a number between 0 and 100.Learn more

comment

commentobject.Learn more

comment.created_at

Returns the timestamp of when the comment was submitted.

Use thedatefilter to convert the timestamp into a more readable format.Learn more

{{ comment.created_at | date: "%b %d, %Y" }}
Feb 26, 2019

comment.id

Returns the id (unique identifier) of the comment.Learn more

comment.author

Returns the author of the comment.Learn more

comment.email

Returns the email address of the comment’s author.Learn more

comment.content

Returns the content of the comment.Learn more

comment.status

Returns the status of the comment.Learn more

comment.updated_at

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 thedatefilter 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 withcomment.idappended to it. This is so the page will automatically scroll to the comment.Learn more

country

的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,USorFRfor 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 eitherimperialormetric.Learn more

Content Objects

Objects that are used to output the content of template and section files, as well as the scripts and stylesheets loaded by Shopify and Shopify apps.Learn more

content_for_header

This object is required intheme.liquidand must be placed inside the HTMLhead标签。It dynamically loads all scripts required by Shopify into the document head.Learn more

{{ content_for_header }}

content_for_index

content_for_indexobject contains the content of the dynamic sections to be rendered on the home page selected through a store's theme editor.Learn more

{{ content_for_index }}

content_for_layout

content_for_layout创动态对象包含的内容erated sections such ascollection.liquidorcart.liquid. It is required intheme.liquidand must be placed inside the HTML标签。Learn more

{{ content_for_layout }}

country_option_tags

Createoptiontags for each country.Learn more

country_option_tags

country_option_tagscreates antag for each country. An attribute nameddata-provincesis 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 itsdata-provincesattribute.country_option_tagsmust be wrapped in {{ country_option_tags }}

currency

currencyobject contains information about a store's currency.Learn more

currency.name

Returns the name of the currency (for exampleUnited States dollarsorEuro).Learn more

currency.iso_code

Returns the ISO code of the currency (for exampleUSDorEUR).Learn more

currency.symbol

Returns the currency's symbol (for example,$or).Learn more

current_tags

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. Thecurrent_tagsvariable is an array that contains all tags that are being used to filter a collection or blog.Learn more

内部collection.liquid

内部collection.liquid,current_tagscontains all product tags that are used to filter a collection.Learn more

Inside blog.liquid

Inside blog.liquid,current_tagscontains all article tags that are used to filter the blog.Learn more

customer_address

customer_addressobject 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

customer_address.id

Returns the id of customer address.Learn more

customer

customerobject contains information about a customer who has a Customer Account. Thecustomercan be used and accessed fromany filein your theme.Learn more

customer.accepts_marketing

Returnstrueif the customer accepts marketing. Returnsfalseif the customer does not.Learn more

customer.addresses

Returns an array of all addresses associated with a customer. Seecustomer_addressfor 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

customer.default_address

Returns the defaultcustomer_address.Learn more

customer.email

Returns the email address of the customer.Learn more

customer.first_name

Returns the first name of the customer.Learn more

customer.has_account

Returnstrueif the email associated with an order is also tied to a Customer Account. Returnsfalseif it is not. Helpful in email templates. In the theme, this will always be true.Learn more

customer.id

Returns the id of the customer.Learn more

customer.last_name

Returns the last name of the customer.Learn more

customer.last_order

Returns the last order placed by the customer, not including test orders.Learn more

Your last order was placed on: {{ customer.last_order.created_at | date: "%B %d, %Y %I:%M%p" }}
Your last order was placed on: April 25, 2014 01:49PM

customer.name

Returns the full name of the customer.Learn more

customer.orders

Returns an array of all orders placed by the customer.Learn more

{% for order in customer.orders %} {{ order.id }} {% endfor %}
\#1088 \#1089 \#1090

customer.orders_count

Returns the total number of orders a customer has placed.Learn more

customer.phone

Returns the phone number of the customer.Learn more

customer.tags

Returns the list of tags associated with the customer.Learn more

{% for tag in customer.tags %} {{ tag }} {% endfor %}
wholesale regular-customer VIP

customer.customer-tax_exempt

Returns whether or not the customer is exempt from taxes.Learn more

customer.total_spent

Returns the total amount spent on all orders.Learn more

date

dateobject returns a date in ISO 8601 format.Learn more

date

You can use the Liquid date filter to output the date in a more readable format.Learn more

discount

discountobject. Note that this object will display a value only if it’s accessed in notifications or in the Order Printer app.Learn more

discount.id

Returns the id of the discount.Learn more

discount.title

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 asdiscount.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

返回折扣的储蓄总额if it has been applied to multiple line items. The negative version oftotal_amount. Use a money filter to return the value in a monetary format.Learn more

discount.type

Returns the type of the discount.Learn more

discount allocation

discount_allocationobject 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 thecheckout.liquidlayout file.Learn more

discount_allocation.amount

的discounted amount on a line item by a particular discount.Learn more

discount_allocation.discount_application

的discount application that allocates the amount on the line item.Learn more

discount application

discount_applicationobject 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 thediscount_allocationobject 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:的discount applies to all line items.
entitled:的discount applies to a particular subset of line items, often defined by a condition.
explicit:的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:

line_item
shipping_lineLearn more

discount_application.title

的customer-facing name of the discount. For example,Welcome10orCBBWQQAKYBYY.Learn more

discount_application.total_allocated_amount

的total amount that the price of an order is reduced by the discount.Learn more

discount_application.type

的type of the discount.typehas the following possible values:
automatic
discount_code
manual
scriptLearn more

discount_application.value

的value of the discount.Learn more

discount_application.value_type

的value type of the discount.value_typehas the following possible values:
fixed_amount
percentageLearn more

external_video

的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

external_video.external_id

Returns the ID of the external video.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.host

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 theproductdetails page of the Shopify admin.Learn more

filter

的filter object represents a storefront filter.Learn more

filter.active_values

Returns an array of filter_value objects that are currently active. Only applies tolisttype filters.Learn more

filter.inactive_values

Returns an array of filter_value objects that are currently inactive. Only applies tolisttype filters.Learn more

filter.label

返回customer-facing label for the filter.Learn more

filter.max_value

Returns a filter_value object for the maximum value ofprice_rangetype filters.Learn more

filter.min_value

Returns a filter_value object for the minimum value ofprice_rangetype 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 typeprice_range.Learn more

filter.type

Returns the filter type. Can belistorprice_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 Color filter, then the url_to_remove 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

的filter_value object represents an individual value from a filter object.Learn more

filter_value.active

Returns whether the filter value is active. Returns eithertrueorfalse.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,RedorRouge.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 typeprice_rangealso include an extra component depending on thefilter_valuesource.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

filter_value.value

Returns the value.Learn more

font

的font object is used to access thefont_pickersettings. It can be accessed via the global settings object.Learn more

font.baseline_ratio

Returns the position of the baseline within the em box (measured from the bottom).Learn more

{{ settings.heading_font.baseline_ratio }}
0.091

font.fallback_families

Returns the suggested fallback font families.Learn more

{{ settings.heading_font.fallback_families }}
sans-serif

font.family

Returns the font's name.Learn more

{{ settings.heading_font.family }}
"Neue Haas Unica"

font.style

Returns the selected font style.Learn more

{{ settings.heading_font.style }}
normal

font.system?

Returnstrueif 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

font.weight

Returns the selected font weight.Learn more

{{ settings.heading_font.weight }}
400

font.variants

Returns all of the variants within the font's family. Each of the variants is also afontobject.Learn more

{% for variant in settings.heading_font.variants %} {{ variant.family }} {% endfor %}

forloop

forloopobject contains attributes of its parent for loop.Learn more

forloop.first

Returnstrueif it’s the first iteration of the for loop. Returnsfalseif 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

返回当前索引的瞧op, 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

返回当前索引的瞧op, 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

Returnstrueif it’s the last iteration of the for loop. Returnsfalseif 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

Returnsforloop.indexin 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

Returnsforloop.index0in 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

 {% for product in collections.frontpage.products %} {% capture length %}{{ forloop.length }}{% endcapture %} {% endfor %} {{ length }}
10

form

formobject 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 toformtags with the "address" parameter.Learn more

form.address2

Returns the second address line associated with the address, if it exists. Exclusive toformtags with the "address" parameter.Learn more

form.author

Returns the name of the author of the blog article comment. Exclusive toformtags with the "article" parameter.Learn more

form.body

Returns the content of the blog article comment. Exclusive toformtags with the "article" parameter.Learn more

form.city

Returns the city associated with the address. Exclusive toformtags with the "address" parameter.Learn more

form.company

Returns the company name associated with the address, if it exists. Exclusive toformtags with the "address" parameter.Learn more

form.country

Returns the country associated with the address. Exclusive toformtags with the "address" parameter.Learn more

form.email

Returns the email address of the blog article comment’s author. Exclusive toformtags with the "article" parameter.Learn more

form.country

Returns the country associated with the address. Exclusive toformtags 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 %}
 author

form.first_name

Returns the first name associated with the address. Exclusive toformtags 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 toformtags with the "address" parameter.Learn more

form.password_needed

Used only forformtags with the "customer_login" parameter. Theform.password_neededattribute always returnstrue.Learn more

form.phone

Returns the telephone number associated with the address, if it exists. Exclusive toformtags with the "address" parameter.Learn more

form.posted_successfully?

Returnstrueif the form was submitted successfully, orfalseif the form contained errors. All forms but the address form set this property. The address form is always submitted successfully.Learn more

{% if form.posted_successfully? %} Comment posted successfully! {% else %} {{ form.errors | default_errors }} {% endif %}

form.province

Returns the province or state associated with the address. Exclusive toformtags 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 toformtags with the "address" parameter.Learn more

{{ form.set_as_default_checkbox }}

form.zip

Returns the zip code or postal code associated with the address. Exclusive to form tags with the "address" parameter.Learn more

fulfillment

fulfillmentobject.Learn more

fulfillment.tracking_company

Returns the name of the fulfillment service.Learn more

fulfillment.tracking_number

Returns a fulfillment’s tracking number, if it exists.Learn more

Tracking Number: {{ fulfillment.tracking_number }}
Tracking Number: 1Z5F44813600X02768

fulfillment.tracking_url

Returns the URL for a tracking number.Learn more

{{ fulfillment.tracking_url }}
http://wwwapps.ups.com/etracking/tracking.cgi?InquiryNumber1=1Z5F44813600X02768&TypeOfInquiryNumber=T&AcceptUPSLicenseAgreement=yes&submit=Track

fulfillment.fulfillment_line_items

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: 
    {% for line in fulfillment.fulfillment_line_items %}
  • {{ line.line_item.title }} × {{ line.quantity }}
  • {% endfor %}
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.

gift_card

gift_cardobject can be accessed in the following templates:
的Gift card created email notification template ‘Email Notifications > Gift card created’
. Thegift_card.liquidtemplate.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

Returnstrueif the card is enabled, orfalseif the card is disabled.Learn more

gift_card.expired

Returnstrueif the card is expired, orfalseif 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

group对象包含s information about each default rule set in therobotsobject for therobots.txtfile.Learn more

group.rules

Returns of a list ofruleobjects for each rule in the group.Learn more

group.sitemap

Returns the group'ssitemapobject. If the group doesn't require a sitemap, then this returnsblank.

的sitemap can be accessed at/sitemap.xml.

Learn more

group.user_agent

Returns the group'suser_agentobject.Learn more

image

imageobject 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?

Returnstrueif the image has been associated with a variant. Returnsfalseotherwise. 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

image.id

Returns theidof the image.Learn more

image.media_type

Returns the type of the object (image).Learn more

image.position

Returns the position of the image, starting at 1. This is the same as outputtingforloop.index.Learn more

image.preview_image

Returns a preview image for the image, when accessed through amediaobject. For example,product.featured_media.preview_image.Learn more

image.product_id

Returns the id of the image's product.Learn more

image.src

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

line_item

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_allocationsis 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 toline_item.final_pricetimesline_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 returnmanual.Learn more

line_item.gift_card

Returnstrueif the line item's product is a gift card, orfalseif it is not.Learn more

line_item.grams

Returns the weight of the line item. Use theweight_with_unitfilter to format the weight.Learn more

line_item.image

Returns the line item image.Learn more

{{ line_item.image | img_url: 'small' | img_tag }}

line_item.id

Returns the line item's ID.

的line item ID differs depending on the context:

-cart.itemsreturns 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_itemsreturns a temporary unique hash generated for the checkout.
-order.line_itemsreturns a unique integer ID.

Learn more

line_item.key

Returns a unique identifier for each item in the cart.Learn more

line_item.line_level_discount_allocations

Returns a list of line-specificdiscount_allocationobjects 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

如果一个脚本应用返回折扣信息ed 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

{% unless line_item.product.has_only_default_variant %} 
    {% for option in line_item.options_with_values %}
  • {{ option.name }}: {{ option.value }}
  • {% endfor %}
{% endunless %}
  • Size: 42mm
  • Color: Silver
  • Strap: Stainless Steel

line_item.original_line_price

Returns the original price of the line item before discounts were applied.Learn more

line_item.original_price

Returns the original price of the line item before discounts were applied.Learn more

line_item.product

Returns theproductof the line item.Learn more

line_item.product_id

Returns the id of the line item’s product.Learn more

line_item.properties

Returns an array of custom information for an item that has been added to the cart.Learn more

{% assign propertySize = line_item.properties | size %} {% if propertySize > 0 %} 
    {% for property in line_item.properties %}
  • {{ property.first }}: {{ property.last }}
  • {% endfor %}
{% endif %}
Monogram: My dog is the cutest Gift wrap: Yes

line_item.quantity

Returns the quantity of the line item.Learn more

line_item.requires_shipping

Returnstrueif the line item requires shipping, orfalseif 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 aselling_plan_allocationobject 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

Returnstrueif the line item is taxable, orfalseif 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.titlecombines both the line item’sproduct.titleand the line item’svariant.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 aunit_price_measurementobject for the line item.Learn more

line_item.url

Returns the URL to the product page using variant deep-linking.Learn more

{{ line_item.title | link_to: line_item.url }}
T-Shirt - Small

line_item.url_to_remove

Returns a URL that can be used to remove the line item from the cart. This is only valid within the context of cart line items.Learn more

line_item.variant

Returns the variant of the line item.Learn more

line_item.variant_id

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

localization

localizationobject contains information about the currencies and languages that a store supports.Learn more

localization.available_countries

Returns a list ofcountryobjects for each country that the store supports.Learn more

localization.available_languages

Returns a list ofshop_localeobjects for each language that the currently selected country supports.Learn more

localization.country

Returns thecountryobject for the currently selected country.Learn more

localization.language

Returns theshop_localeobject for the currently selected language.Learn more

location

locationobject contains location information for individual store locations.Learn more

location.address

Returns theaddressobject corresponding to the location.Learn more

location.id

Returns the ID of the location.Learn more

location.latitude

Returns the latitude associated with the location. Returnsnilif the address is not verified.Learn more

location.longitude

Returns the longitude associated to the location. Returnsnilif the address is not verified.Learn more

location.name

Returns the name of location.Learn more

measurement

measurementobject contains measurement information forweight,volume, anddimensiontype metafields.Learn more

measurement.type

Returns the measurement type. Can bedimension,volume, orweight.Learn more

measurement.unit

Returns the name of associated unit for the measurement type. For example, if the type isweight, then the unit might begrams.Learn more

measurement.value

Returns the measurement value.Learn more

media

mediaobject represents an object returned in aproduct.mediaarray. 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

media.id

Returns the ID of the media.Learn more

media.media_type

Returns the media type of the object. Themedia_typeproperty can be used to filter theproduct.media arrayfor all media of a desired type.Learn more

{% assign images = product.media | where: "media_type", "image" %} {% for image in images %} {{ image.alt }} {% endfor %}
Image of the black stroller Image of the grey stroller

media.position

Returns the position of the specific media object in theproductobject's media array.Learn more

media.preview_image

Returns a preview image for the media.Learn more

metafield

Metafields make it possible to store additional information for articles, blogs, collections, customers, orders, pages, products, the shop, and variants. You can access themetafieldobject through the metafields attribute of these resources.Learn more

metafield.type

Returns the metafield type.Learn more

metafield.value

Returns the metafield value.Learn more

model

的model object can be accessed from the product object'smediaattribute. Themodelobject 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

model.id

Returns themedia.idof the model.Learn more

model.media_type

Returns the type of the object (model). This can be used to filter theproductobject's media array.Learn more

{% assign models = product.media | where: "media_type", "model" %} {% for model in models %} {{ model.alt }} {% endfor %}
Model of the black stroller Model of the grey stroller

model.position

Returns the position of the model in theproductobject's media array.Learn more

model.preview_image

Returns preview image of the model.Learn more

model.sources

Returns an array of model source objects.Learn more

model_source

model_sourceobject can be accessed from the model object'ssourcesarray. Themodel_sourceobject 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

order

orderobject can be accessed in Liquid templates withcustomer.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 %} 

Order notes:

    {% for attribute in order.attributes %}
  • {{ attribute | first }}: {{ attribute | last }}
  • {% endfor %}
{% endif %}

Order notes:

  • Message to merchant: I love your products! Thanks!

order.billing_address

Returns the billing address of the order.Learn more

order.cancelled

Returnstrueif an order is canceled, returnsfalseif it is not.Learn more

order.cancelled_at

Returns the timestamp of when an order was canceled. Use thedatefilter 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
otherLearn more

order.cancel_reason_label

Returns the translated output of an order’sorder.cancel_reasonLearn more

English: {{ order.cancel_reason }} French: {{ order.cancel_reason_label }}
English: Items unavailable French: Produits indisponibles

order.created_at

Returns the timestamp of when an order was created. Use thedatefilter to format the timestamp.Learn more

order.customer

Returns the customer associated with the order.Learn more

order.customer_url

Returns the URL of the customer’s account page.Learn more

{{ order.name | link_to: order.customer_url }}
#1025

order.discount_applications

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
voidedLearn more

order.financial_status_label

Returns the translated output of an order’sfinancial_status.Learn more

English: {{ order.financial_status }} French: {{ order.financial_status_label }}
English: Paid French: Payée

order.fulfillment_status

Returns the fulfillment status of an order.Learn more

order.fulfillment_status_label

Returns the translated output of an order’sfulfillment_status.Learn more

English: {{ order.fulfillment_status }} French: {{ order.fulfillment_status_label }}
English: Unfulfilled French: Non confirmée

order.line_items

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: {{ order.line_items_subtotal_price | money }}
 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 ofshipping_methodvariables 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 oftax_linevariables for an order.Learn more

{% for tax_line in order.tax_lines %} Tax ({{ tax_line.title }} {{ tax_line.rate | times: 100 }}%): {{ tax_line.price | money }} {% endfor %}
Tax (GST 14.0%): $25

order.tax_price

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.

order.total_net_amountis calculated after refunds are applied. The value is equivalent toorder.total_priceminusorder.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

Other Objects

Other Liquid objects that are only used in specific circumstances.Learn more

additional_checkout_buttons

Returnstrueif a merchant's store has any payment providers with offsite checkouts, such as PayPal Express Checkout. Useadditional_checkout_buttonsto check whether these gateways exist.Learn more

{% if additional_checkout_buttons %} 
{{ content_for_additional_checkout_buttons }}
{% endif %}

content_for_additional_checkout_buttons

Returns checkout buttons for any active payment providers with offsite checkouts.Learn more

{% if additional_checkout_buttons %} 
{{ content_for_additional_checkout_buttons }}
{% endif %}

page

pageobject.Learn more

page.author

Returns the author of a page.Learn more

page.content

Returns the content of a page.Learn more

page.handle

Returns the handle of a page.Learn more

page.id

Returns the id of a page.Learn more

page.published_at

Returns the timestamp of when the page was created. Use thedatefilter 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.liquidsuffix. Returnsnilif a custom template is not assigned to the page.Learn more

 {{ page.template_suffix }}
contact

page.title

Returns the title of a page.Learn more

page.url

Returns the relative URL of a page.Learn more

{{ page.url }}
/pages/about-us

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, thepage_imageis the resource's featured image if it exists. For example, a product page'spage_imageis the same as itsproduct.featured_image. If a featured image does not exist, then thepage_imageis based on the store's social sharing image set in the admin.Learn more

{{ page_image | img_url }}
//cdn.shopify.com/s/files/1/0987/1148/files/nice-candle-and-rocks_300x300.jpg?v=1590502771

paginate

的paginate tag’s navigation is built using the attributes of thepaginateobject. You can also use thedefault_paginationfilter 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_offsetwould 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.itemswould 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

返回一部分变量中的下一个链接pagination navigation.Learn more

{% if paginate.next.is_link %} {{ paginate.next.title }} {% endif %}
 Next »

paginate.previous

Returns the part variable for the Previous link in the pagination navigation.Learn more

{% if paginate.previous.is_link %} {{ paginate.previous.title }} {% endif %}
 « Previous

paginate.page_size

Returns the number of items displayed per page.Learn more

paginate.pages

Returns the number of pages created by the pagination tag.Learn more

part

Each part returned by thepaginate.partsarray represents a link in the pagination's navigation.Learn more

part.is_link

Returnstrueif the part is a link, returnsfalseif it is not.Learn more

part.title

Returns the title of the part.Learn more

part.url

Returns the URL of the part.Learn more

policy

Apolicyrepresents an individual policy of theshop.policiesobject. An individual policy can also be referenced directly on theshopobject. For exampleshop.privacy_policy.Learn more

policy.body

Returns the content of the policy.Learn more

{% assign policy = shop.privacy_policy %} {{ policy.body }}

PRIVACY STATEMENT

SECTION 1 - WHAT DO WE DO WITH YOUR INFORMATION?

When you purchase something from our store...

policy.title

Returns the title of the policy.Learn more

{% for policy in shop.policies %} {{ policy.title }} {% endfor %}
Privacy policy Refund policy Shipping policy Terms of service

policy.url

Returns the URL of the policy.Learn more

{% for policy in shop.policies %} {{ policy.url }} {% endfor %}
/policies/privacy-policy /policies/refund-policy /policies/shipping-policy /policies/terms-of-service

product

productobject.Learn more

product.available

Returnstrueif a product is available for purchase. Returnsfalseif all of the products’ variantsinventory_quantityvalues are zero or less, and theirinventory_policyis 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 toproduct.compare_at_price_min.

If none of the product variants have a value for compare at price, thenproduct.compare_at_pricereturnsnil.

Learn more

product.compare_at_price_max

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

Returnstrueif thecompare_at_price_minis different from thecompare_at_price_max. Returnsfalseif they are the same.Learn more

product.content

Returns the description of the product. Alias forproduct.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.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, itsvariant.inventory_quantitymust be greater than zero orvariant.inventory_policymust be set to continue. A variant with noinventory_policyis considered available.Learn more

product.handle

Returns the handle of a product.Learn more

product.gift_card?

Returnstrueif the product is a gift card.Learn more

product.has_only_default_variant

Returnstrueif the product only has the default variant. This lets you determine whether to show a variant picker in your product forms.

Products that don't have customized variants have a single default variant with its "Title" option set to "Default Title".Learn more

{% if product.has_only_default_variant %}  {% else %}  {% endif %}

product.id

Returns the id of the product.Learn more

product.images

Returns an array of the product’s images. Use theproduct_img_urlfilter to link to the product image on Shopify’s Content Delivery Network.Learn more

{% for image in product.images %}  {% endfor %}
  

product.media

Returns an array of a product's associatedmediaobjects, 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 ofoptions_by_nameare case-insensitive.Learn more

product.options_with_values

Returns an array of the product's options.Learn more

{% for product_option in product.options_with_values %}  {% endfor %}

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

Returnstrueif the product’s variants have varying prices. Returnsfalseif 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

Returnstruewhen all variants of the product havevariant.requires_selling_planset totrue.Learn more

product.selected_variant

Returns the variant object of the currently-selected variant if there is a valid?variant=parameter in the URL. Returnsnilif 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, itsvariant.inventory_quantitymust be greater than zero orvariant.inventory_policymust be set to continue. A variant with noinventory_managementis considered available.Learn more

product.selected_or_first_available_selling_plan_allocation

Returns aselling_plan_allocationobject 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 returnsnil.

Learn more

product.selected_selling_plan

Returns theselling_planobject based on the value of theselling_planURL parameter, if the parameter value is a valid selling plan ID.

For example, when given the URL parameter?selling_plan=789, the property returns theselling_planobject with ID789.

Learn more

product.selected_selling_plan_allocation

Returns theselling_plan_allocationobject 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 ID12345and the selling plan with ID8765.

Learn more

product.selling_plan_groups

An array ofselling_plan_groupobjects 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.liquidsuffix. Returnsnilif a custom template is not assigned to the product.Learn more

 {{ product.template_suffix }}
wholesale

product.title

Returns the title of the product.Learn more

product.type

Returns the type of the product.Learn more

product.url

Returns the relative URL of the product.Learn more

{{ product.url }}
/products/awesome-shoes

product.variants

Returns an array the product’s variants.Learn more

product.vendor

Returns the vendor of the product.Learn more

product_option

product_optionobject is available for each option in a product options array. The product options array is accessible viaproduct.options_with_values.Learn more

product_option.name

Returns the product option's name.Learn more

    {% for product_option in product.options_with_values %}
  • {{ product_option.name }}
  • {% endfor %}
  • Color
  • Size

product_option.position

Returns the product option's position in the product options array.Learn more

    {% for product_option in product.options_with_values %}
  • {{ product_option.position }} - {{ product_option.name }}
  • {% endfor %}
  • 1 - Color
  • 2 - Size

product_option.selected_value

Returns the currently selected value for this product option.Learn more

product_option.values

Returns an array of possible values for this product option.Learn more

    {% for value in product_option.values %}
  • {{ value }}
  • {% endfor %}
  • Red
  • Green

recommendations

recommendationsobject 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. Therecommendationsobject can be used and accessed fromany filein your theme.Learn more

recommendations.performed

Returnstrueif 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 therecommendationsobject 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 noLearn more

recommendations.products_count

Returns the number of product recommendations, or returns 0 ifrecommendations.performedisfalse.Learn more

recommendations.products

Returns product recommendations. These objects are products. Doesn't return any product ifrecommendations.performedis 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 %} 
Placeholder animation
{% endif %}
When the enclosing section is rendered synchronously: Placeholder animation --------------------- When the enclosing section is rendered from the endpoint /recommendations/products?section_id=&product_id=: Product title Another product title

request

requestobject returns information about the domain used to access your store and the page being accessed.Learn more

request.design_mode

Returnstrueif the request is being made from the theme editor in the Shopify admin.Learn more

{%如果请求。design_mode %}  {% endif %}

request.host

You can userequest.hostto check which domain a customer is visiting from.Learn more

{{ request.host }}
your-store.myshopify.com

request.locale

Returns theshop_localeof the current request.Learn more

{{ request.locale.name }}
English

request.page_type

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

{{ request.page_type }}
collection

request.path

Returns the path to the current page.Learn more

{{ request.path }}
/collections/classics/products/chambray-shirt

robots

robotsobject contains the default rule groups for therobots.txtfile.Learn more

robots.default_groups

Returns a list ofgroupobjects for each group of rules.Learn more

routes

You can use theroutesobject 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

routes.account_addresses_url

Returns the account addresses URL.Learn more

routes.account_url

Returns the account URL.Learn more

routes.account_login_url

Returns the account login URL.Learn more

routes.account_logout_url

Returns the account logout URL.Learn more

routes.account_recover_url

Returns the account recover URL.Learn more

routes.account_register_url

Returns the account register URL.Learn more

routes.all_products_collection_url

Returns the URL that points to the collection for all products.Learn more

routes.cart_url

Returns the cart URL.Learn more

routes.cart_add_url

Returns the URL that accepts items to be added to a cart.Learn more

routes.cart_change_url

Returns the URL that allows a cart to be changed.Learn more

routes.cart_clear_url

Returns the URL that will clear the cart.Learn more

routes.collections_url

Returns the collections URL.Learn more

routes.product_recommendations_url

Returns the product recommendations URL.Learn more

routes.root_url

Returns the root URL.Learn more

routes.search_url

Returns the search URL.Learn more

rule

的rule object returns an individual rule for therobots.txtfile, which tells crawlers which pages can, or can't, be accessed. It consists of a directive, which can be eitherAlloworDisallow, and a value of the associated URL path.

For example:

Disallow: /policies/

Learn more

rule.directive

Returns the rule directive, which can be eitherAllowto allow crawlers to access the specified URL, orDisallowto block them.Learn more

rule.value

Returns the associated URL path for the rule.Learn more

script

scriptobjects contain information about the Shopify Scripts published in your store.Learn more

script.id

Returns the script's ID.Learn more

script.name

Returns the script's name.Learn more

{% if scripts.cart_calculate_line_items %} 

Check out our sale: {{ scripts.cart_calculate_line_items.name }}

{% endif %}
Check out our sale: Buy one chambray shirt and get a second for half price

section

sectionobject 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.settings

Returns an object of the section settings set in the theme editor. Retrieve setting values by referencing the setting's uniqueid.Learn more

{{ section.settings.heading }}

This week's best selling items

Weekly promotion

This week's best selling items

selling_plan

selling_planobject captures the intent of a selling plan applied on a line item.Learn more

selling_plan.description

Returns the selling plan's description.Learn more

selling_plan.group_id

的unique ID of theselling_plan_groupthat the selling plan belongs to.Learn more

selling_plan.id

的unique ID of the selling plan.

This value is used when submitting a selling plan to the cart.

Learn more

selling_plan.name

的selling plan's name.Learn more

selling_plan.options

An array ofselling_plan_optionobjects that contain information about the selling plan's value for a particularselling_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 ofselling_plan_price_adjustmentobjects. Aselling_plan_price_adjustmentdescribes how a selling plan changes the price of variants for a given period.

的maximum length of the array is 2. The array is empty when the selling plan doesn't create any price adjustments.

Learn more

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

Returnstruewhen the selling plan includes multiple recurring deliveries.Learn more

selling_plan.selected

Returnstrueif the selling plan's ID is identified by theselling_planURL parameter.Learn more

selling_plan_option

Aselling_plan_optionobject contains the name and values of an individual item in theselling_plan.optionsarray.Learn more

option.name

Returns the selling plan option’s name.Learn more

option.position

Returns the index of the the option amongst all theselling_plan.options.Learn more

option.value

Returns the selling plan option’s value.Learn more

selling_plan_price_adjustment

Eachselling_plan_price_adjustmentof the selling plan maps to aselling_plan_allocation_price_adjustmentin theselling_plan_allocationarray. Theselling_plan.price_adjustmentsdescribe the intent of the selling plan, whileselling_plan_allocation.price_adjustmentscontains the resulting money amounts.Learn more

price_adjustment.order_count

的number of orders that this price adjustment applies to.

的value isnilwhen the price adjustment is applied either on an ongoing basis or for the rest of selling plan's duration.

Learn more

price_adjustment.position

的1-based index of theselling_plan_price_adjustmentin theselling_plan.price_adjustmentsarray.Learn more

price_adjustment.value

A float representing the value of price adjustment. Thevalue_typedetermines what this value actually represents.Learn more

price_adjustment.value_type

的type of the price adjustment, which can befixed_amount,percentage, orprice.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, thepriceandcompare_at_pricevalues are multiplied by the number of deliveries.

Learn more

selling_plan_allocation.compare_at_price

的selling plan allocation's compare at price.

This value is set to the variant’s price without the selling plan applied. If the variant'spricewith the selling plan applied is the same, then this value isnil.

Learn more

selling_plan_allocation.per_delivery_price

的price charged for each delivery included in a selling plan.

When a selling plan includes multiple deliveries, theper_delivery_pricevalue will be theselling_plan_allocation.pricedivided by the number of deliveries.

Learn more

{{ selling_plan_allocation.price | money }} {% if selling_plan_allocation.per_delivery_price != selling_plan_allocation.price %} ({{selling_plan_allocation.per_delivery_price }} each) {% endif %}
$1,200.00 ($100.00 each)

selling_plan_allocation.price

的price of the line item with the selling plan applied.Learn more

selling_plan_allocation.price_adjustments

An array ofselling_plan_allocation_price_adjustmentobjects.

的maximum length of the array is 2. The array is empty when the selling plan doesn't create any price adjustments.

Learn more

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_allocation.selling_plan

selling_planthat created the allocation.Learn more

selling_plan_allocation.selling_plan_group_id

的ID of theselling_plan_groupto which the allocation’s selling plan belongs.Learn more

selling_plan_allocation.unit_price

的unit price of the variant associated with the selling plan.

If the variant has no unit price, then this property returnsnil.

Learn more

selling_plan_allocation_price_adjustment

Eachselling_plan_allocation_price_adjustmentof the selling plan allocation maps to aselling_plan_price_adjustmentin theselling_plan.price_adjustmentsarray. Theselling_plan.price_adjustmentsdescribes the intent of the selling plan, whileselling_plan_allocation.price_adjustmentscontains the resulting money amounts.Learn more

price_adjustment.position

的1-based index of theselling_plan_allocation_price_adjustmentin theselling_plan_allocation.price_adjustmentsarray.Learn more

price_adjustment.price

的price that will be charged for theselling_plan_allocation_price_adjustmentperiod.Learn more

selling_plan_group

A group of selling plans available for some or all of a product's variants. Selling plans in a group all share the sameselling_plan_option.namevalues.Learn more

selling_plan_group.id

A unique ID for the selling plan group.Learn more

selling_plan_group.name

的name of the selling plan group.Learn more

selling_plan_group.options

An array ofselling_plan_group_optionobjects.Learn more

{% for option in selling_plan_group.options %}   {% endfor %}
 

selling_plan_group.selling_plan_selected

Returnstrueif the selected selling plan is part of the selling plan group. The selected selling plan is based on the URL parameterselling_plan.Learn more

selling_plan_group.selling_plans

An array ofselling_planobjects that belong to theselling_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 returnsnil.

Learn more

selling_plan_group_option

Aselling_plan_group_optionobject contains the name and values of an individual item in theselling_plan_group.optionsarray.Learn more

option.name

Returns the selling plan option’s name.Learn more

option.position

Returns the index of the the option amongst all theselling_plan_group.options.Learn more

option.selected_value

Returns the value for the selling plan group option when aselling_plan_allocationis selected. The selected selling plan allocation is based on both the URL parametersselling_planandid.Learn more

option.values

An array of values for the selling plan group option.Learn more

shipping_method

shipping_methodobject.Learn more

shipping_method.handle

返回的处理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

shopobject can be used and accessed fromany filein your theme.Learn more

shop.address

You can add the attributes below toshop.addressto 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

{{ shop.address.province_code }}
true

shop.address.street

Returns the shop's street address.Learn more

{{ shop.address.street }}
150 Elgin Street

shop.address.summary

Returns a summary of the shop's address in the form ofstreet, city, state/province, country.Learn more

{{ shop.address.summary }}
150 Elgin Street, Ottawa, Ontario, Canada

shop.address.zip

Returns the postal or zip code of the shop's address.Learn more

{{ shop.address.zip }}
K2P 1L4

shop.checkout.guest_login

Returnstrue如果客户账户为完成一项是可选的checkout and there is a?checkout_urlparameter in the URL. Otherwise, returnsfalse.

Acheckout_urlparameter is created when a visitor comes to the account login page from a link at checkout.

Learn more

shop.collections_count

Returns the number of collections in a shop.Learn more

shop.currency

Returns the shop’s currency in three-letter format (e.g. USD).Learn more

shop.customer_accounts_enabled

Returnstruewhen a customer account is required to complete a checkout. Otherwise, returnsfalse.Learn more

shop.customer_accounts_optional

Returnstruewhen a customer account is option to complete a checkout. Otherwise, returnsfalse.Learn more

shop.description

Returns the description of the shop.Learn more

shop.domain

Returns the primary domain of the shop.Learn more

shop.email

Returns the shop’s email address.Learn more

shop.enabled_currencies

Returns the list of currency objects that the store accepts.

To return the currency of the cart, see the cart.currency object.

返回存储货币,看到shop.currency object.

Learn more

shop.enabled_payment_types

Returns an array of accepted credit cards for the shop. Use thepayment_type_img_urlfilter to link to the SVG image file of the credit card.Learn more

shop.id

Returns the shop's ID.Learn more

shop.metafields

Returns the shop’s metafields. Metafields can only be set using the Shopify API.Learn more

shop.money_format

Returns a string that is used by Shopify to format money without showing the currency.Learn more

shop.money_with_currency_format

Returns a string that is used by Shopify to format money while also displaying the currency.Learn more

shop.name

Returns the shop’s name.Learn more

shop.password_message

Returns the shop’s password page message.Learn more

shop.permanent_domain

Returns the.myshopify.comURL of a shop.Learn more

shop.phone

Returns the shop's phone number.Learn more

shop.policies

Returns an array of your shop's policy objects. You can set these policies in your store's Legal settings in your Shopify admin.Learn more

shop.privacy_policy

Returns a policy object for your store's privacy policy.Learn more

shop.products_count

Returns the number of products in a shop.Learn more

shop.published_locales

Returns an array ofshop_localeobjects. Each object represents a shop locale that's published on the shop.Learn more

shop.refund_policy

Returns a policy object for your store's refund policy.Learn more

shop.secure_url

Returns the full URL of a shop prepended by thehttpsprotocol.Learn more

{{ shop.secure_url }}
https://johns-apparel.com

shop.shipping_policy

Returns a policy object for your store's shipping policy.Learn more

shop.subscription_policy

Returns a policy object for your store's subscription policy.Learn more

shop.terms_of_service

Returns a policy object for your store's terms of service.Learn more

shop.types

Returns an array of all unique product types in a shop.Learn more

{% for product_type in shop.types %} {{ product_type | link_to_type }} {% endfor %}

shop.url

Returns the full URL of a shop.Learn more

{{ shop.url }}
http://johns-apparel.com

shop.vendors

Returns an array of all unique vendors in a shop.Learn more

{% for product_vendor in shop.vendors %} {{ product_vendor | link_to_vendor }} {% endfor %}

shop_locale

Returns information about the shop's locale.Learn more

shop_locale.endonym_name

Returns the locale endonym name.Learn more

{{ shop_locale.endonym_name }}
français canadien

shop_locale.iso_code

Returns the locale code.Learn more

{{ shop_locale.iso_code }}
fr-CA

shop_locale.name

Returns the locale name.Learn more

{{ shop_locale.name }}
Canadian French

shop_locale.primary

Returns whether or not this is the shop's primary locale.Learn more

shop_locale.root_url

返回的根相对URL的地区。Learn more

sitemap

sitemapobject returns the sitemap for a specific group in therobots.txtfile. 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.

sitemapobject consists of aSitemapdirective, and a value of the URL that the sitemap is hosted at.

For example:

Sitemap: https://your-store.myshopify.com/sitemap.xml

Learn more

sitemap.directive

ReturnsSitemap.Learn more

sitemap.value

Returns the URL that the sitemap is hosted at.Learn more

store_availability

store_availabilityobject 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

store_availability.available

Returnstrueif the variant has stock.Learn more

store_availability.location

Returns the location object that the variant is stocked at.Learn more

store_availability.pick_up_enabled

Returnstrueif the variant is stocked at a location that has pickup enabled.Learn more

store_availability.pick_up_time

Returns the amount of time it takes for pickup to be ready, For example,Usually ready in 24 hours. This value is set in the adminwhile setting up the local pickup option.Learn more

tablerow

tablerowobject is used within thetablerow标签。It contains attributes of its parent for loop.Learn more

tablerow.length

Returns the number of iterations of thetablerowloop.Learn more

tablerow.index

Returns the current index of thetablerowloop, starting at 1.Learn more

tablerow.index0

Returns the current index of thetablerowloop, starting at 0.Learn more

tablerow.rindex

Returnstablerow.indexin reverse order.Learn more

tablerow.rindex0

Returnstablerow.index0in reverse order.Learn more

tablerow.first

Returnstrueif it’s the first iteration of thetablerowloop. Returnsfalseif it is not the first iteration.Learn more

tablerow.last

Returnstrueif it’s the last iteration of thetablerowloop. Returnsfalseif it is not the last iteration.Learn more

tablerow.col

返回当前行的指数,从OB欧宝娱乐APP1.Learn more

tablerow.col0

返回当前行的指数,从OB欧宝娱乐APP0.Learn more

tablerow.col_first

Returnstrueif the current column is the first column in a row. Returnsfalseif it is not.Learn more

tablerow.col_last

Returnstrueif the current column is the last column in a row. Returnsfalseif it is not.Learn more

tax_line

tax_lineobject.Learn more

tax_line.title

Returns the title of the tax.Learn more

{{ tax_line.title }}
GST

tax_line.price

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

templateobject has a handful of attributes. Referencing justtemplatereturns the name of the template used to render the current page, with the.liquidextension omitted. Thetemplateobject can be used and accessed fromany filein your theme.Learn more

template

As a best practice, it's recommended that you apply the template name as a CSS class on your HTMLbody标签。Learn more

template.directory

Returns the name of the template's parent directory. Returnsnilfor templates whose parent directory is thetemplates/folder.Learn more

 {{ template.directory }}
customers

template.name

Returns the template's name without the template's custom suffix, if it exists, or the.liquidextension.Learn more

 {{ template.name }}
product

template.suffix

Returns the name of the custom template without thetemplate.nameprefix or the.liquidextension. Returnsnilif a custom template is not being used.Learn more

 {{ template.suffix }}
alternate

theme

themeobject contains information about published themes in a shop. You can also usethemesto 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

theme.name

Returns the name of the theme.Learn more

transaction

transactionobject.Learn more

transaction.id

Returns a unique numeric identifier for the transaction.Learn more

transaction.amount

Returns the amount of the transaction. Use one of the money filters to return the value in a monetary format.Learn more

transaction.name

Returns the name of the transaction.Learn more

{{ transaction.name }}
c251556901.1

transaction.status

Returns the status of the transaction.Learn more

transaction.status_label

Returns the translated output of a transaction’s status.Learn more

transaction.created_at

Returns the timestamp of when the transaction was created. Use thedatefilter 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:

  • authorizationis the reserving of money that the customer has agreed to pay.
  • captureis the transfer of the money that was reserved during the authorization stage.
  • saleis a combination of authorization and capture, performed in one step.
  • voidis the cancellation of a pending authorization or capture.
  • refundis the partial or full refund of the captured money to the customer.
Learn more

transaction.gateway

Returns the name of the payment gateway used for the transaction.Learn more

{{ transaction.gateway }}
Cash on Delivery (COD)

transaction.payment_details

payment_detailsobject contains additional properties related to the payment method used in the transaction.
credit_card_companyreturns the name of the company who issued the customer’s credit card.
credit_card_numberreturns the customer’s credit card number. All but the last four digits are redacted.Learn more

{{ transaction.payment_details.credit_card_company }}: {{ transaction.payment_details.credit_card_number }}
Visa: •••• •••• •••• 1234

unit_price_measurement

unit_price_measurementobject contains information about how units of a product variant are measured. It's used by theunit_priceattribute to calculate unit prices.

Note: Unit prices are only available to stores located in Germany and France.

Learn more

unit_price_measurement.measured_type

Returns the type of measurement as a string. For example,volume.Learn more

unit_price_measurement.quantity_unit

Returns the unit of measurement that's used to measure thequantity_value. For example,l.Learn more

unit_price_measurement.quantity_value

Returns the quantity of the unit that's included. For example,2.5.Learn more

unit_price_measurement.reference_unit

Returns the unit of measurement that's used to measure thereference_value. For example,ml.Learn more

unit_price_measurement.reference_value

Returns the reference value that's used to illustrate the base unit price. For example,100.Learn more

user_agent

user_agentobject returns the user-agent, which is the name of the crawler, for a specificgroupin therobots.txtfile. It consists of aUser-agentdirective, and a value of the user-agent name.

For example:

User-agent: *

Learn more

user_agent.directive

ReturnsUser-agent.Learn more

user_agent.value

Returns the user-agent name.Learn more

variant

variantobject.Learn more

variant.available

Returnstrueif the variant is available to be purchased, orfalseif it is not. In order for a variant to be available, itsvariant.inventory_quantitymust be greater than zero orvariant.inventory_policymust be set to continue. A variant with novariant.inventory_managementis also considered available.Learn more

variant.barcode

Returns the variant’s barcode.Learn more

variant.compare_at_price

Returns the variant’s compare at price. Use one of the money filters to return the value in a monetary format.Learn more

variant.matched

Returns whether the variant has been matched by astorefront filter. Returnstrueif it's been matched, andfalseif not.Learn more

variant.id

Returns the variant’s unique id.Learn more

variant.image

Returns theimageobject associated to the variant.Learn more

{{ variant.image.src }}
products/red-shirt.jpeg

variant.incoming

Returnstrueif the variant has incoming inventory.Learn more

variant.inventory_management

Returns the variant’s inventory tracking service.Learn more

variant.inventory_policy

Returns the stringcontinueif 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. Returnsdenyif 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.

Learn more

variant.product

Returns the parentproductobject.Learn more

variant.requires_shipping

Returns a boolean result as to whether the variant is set to require shipping.Learn more

variant.selected

Returnstrueif the variant is currently selected by the?variant=URL parameter.

Returnsfalseif the variant is not selected by a URL parameter.

Learn more

variant.selected_selling_plan_allocation

Returns aselling_plan_allocationobject based on the URL parameterselling_plan.

For example, given the URL parameters?variant=12345&selling_plan=8765, the selling plan allocation for the variant12345with a selling planidof8765is returned.

If there is no selected selling plan allocation, then this property returnsnil.

Learn more

variant.selling_plan_allocations

An array ofselling_plan_allocationobjects available for the variant.Learn more

variant.sku

Returns the variant’s SKU.Learn more

variant.store_availabilities

Returns an array ofstore_availabilityobjects ifvariant.selectedistrue, or the variant is the product's first available variant.Learn more

variant.taxable

Returns a boolean result as to whether taxes will be charged for this variant.Learn more

variant.title

Returns the concatenation of all the variant’s option values, joined by a /.Learn more

 {{ variant.title }}
Red / Small / Wool

variant.unit_price

Returns the unit price of the product variant. The price reflects any discounts that are applied to the line item.

Unit prices are available only to stores located in Germany or France.Learn more

variant.unit_price_measurement

Returns a unit_price_measurement object for the product variant.

Unit prices are available only to stores located in Germany or France.Learn more

variant.url

Returns the variant’s absolute URL.Learn more

{{ variant.url }}
http://my-store.myshopify.com/products/t-shirt?variant=12345678

variant.weight

Returns the variant’s weight in grams. Use theweight_with_unitfilter 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 theweight_in_unitattribute and theweight_with_unitfilter.Learn more

variant.weight_in_unit

Returns the weight of the product converted to the unit configured on the variant. Works well paired with theweight_unitattribute and theweight_with_unitfilter.Learn more

video

videoobject can be accessed from theproductobject'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

video.id

Returns themedia_idof the video.Learn more

video.media_type

Returns the type of the object (video). This can be used to filter theproductobject's media array.Learn more

{% assign videos = product.media | where: "media_type", "video" %} {% for video in videos %} {{ video.alt }} {% endfor %}
Promotional video for stroller Features video for stroller

video.position

Returns the position of the video in theproductobject's media array.Learn more

video.preview_image

Returns a previewimagefor the video.Learn more

video.sources

Returns an array ofvideo_sourceobjects.Learn more

video_source

video_sourceobject can be accessed from thevideoobject'ssourcesarray. Thevideo_sourceobject 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

video_source.mime_type

Returns theMIME typeof the video source file.Learn more

video_source.url

Returns the URL of the video source file.Learn more

video_source.width

Returns the width of the video source file.Learn more