mirror of
https://github.com/kemko/liquid.git
synced 2026-01-06 10:15:40 +03:00
initial commit
This commit is contained in:
217
documentation/objects/address.md
Normal file
217
documentation/objects/address.md
Normal file
@@ -0,0 +1,217 @@
|
||||
---
|
||||
layout: default
|
||||
title: address
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# address
|
||||
|
||||
The <code>address</code> object contains information entered by a customer in Shopify's checkout pages. Note that a customer can enter two addresses: **billing address** or **shipping address**.
|
||||
|
||||
{{ '/themes/address.jpg' | image }}
|
||||
|
||||
When accessing attributes of the <code>address</code> object, you must specify which address you want to target. This is done by using either <code>shipping_address</code> or <code>billing_address</code> before the attribute.
|
||||
|
||||
<code>address</code> can be used in email templates, the Thank You page of the checkout, as well as in apps such as Order Printer.
|
||||
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.name", "address-name" %}
|
||||
|
||||
Returns the values of the First Name **and** Last Name fields of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
Hello, {{ billing_address.name }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Hello, Bob Biller
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.first_name", "address-first_name" %}
|
||||
|
||||
Returns the value of the First Name field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.last_name", "address-last_name" %}
|
||||
|
||||
Returns the value of the Last Name field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.address1", "address-address1" %}
|
||||
|
||||
Returns the value of the Address1 field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.address2", "address-address2" %}
|
||||
|
||||
Returns the value of the Address2 field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.street", "address-street" %}
|
||||
|
||||
Returns the combined values of the Address1 and Address2 fields of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shipping_address.street }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
126 York St, Shopify Office
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.company", "address-company" %}
|
||||
|
||||
Returns the value of the Company field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.city", "address-city" %}
|
||||
|
||||
Returns the value of the City field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.province", "address-province" %}
|
||||
|
||||
Returns the value of the Province/State field of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ billing_address.province }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Ontario
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.province_code", "address-province_code" %}
|
||||
|
||||
Returns the abbreviated value of the Province/State field of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ billing_address.province_code }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
ON
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.zip", "address-zip" %}
|
||||
|
||||
|
||||
Returns the value of the Postal/Zip field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.country", "address-country" %}
|
||||
|
||||
Returns the value of the Country field of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shipping_address.country }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Canada
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.country_code", "address-country_code" %}
|
||||
|
||||
Returns the value of the Country field of the address in ISO 3166-2 standard format.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shipping_address.country_code }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
CA
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "address.phone", "address-phone" %}
|
||||
|
||||
Returns the value of the Phone field of the address.
|
||||
|
||||
|
||||
267
documentation/objects/article.md
Normal file
267
documentation/objects/article.md
Normal file
@@ -0,0 +1,267 @@
|
||||
---
|
||||
layout: default
|
||||
title: article
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# article
|
||||
|
||||
The <code>article</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.author", "article-author" %}
|
||||
|
||||
<p>Returns the full name of the article's author.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.comments", "article-comments" %}
|
||||
|
||||
Returns the published <a href="/themes/liquid-documentation/objects/comment/">comments</a> of an article. Returns an empty array if comments are disabled.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.comments_count", "article-comments_count" %}
|
||||
|
||||
<p>Returns the number of published comments for an article.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.comments_enabled?", "article-comments_enabled?" %}
|
||||
|
||||
<p>Returns <code>true</code> if comments are enabled. Returns <code>false</code> if comments are disabled.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.comment_post_url", "article-comment_post_url" %}
|
||||
|
||||
<p>Returns the relative URL where POST requests are sent to when creating new comments.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ article.comment_post_url }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
/blogs/news/10582441-sale-starts-today/comments
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.content", "article-content" %}
|
||||
|
||||
<p>Returns the content of an article.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.created_at", "article-created_at" %}
|
||||
<p>Returns the timestamp of when an article was created. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#date">date filter</a> to format the timestamp.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ article.created_at | date: "%a, %b %d, %y" }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Fri, Sep 16, 11
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.excerpt", "article-excerpt" %}
|
||||
<p>Returns the excerpt of an article.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.excerpt_or_content", "article-excerpt_or_content" %}
|
||||
<p>Returns <code>article.excerpt</code> of an article if it exists. Returns <code>article.content</code> if an excerpt does not exist for the article.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.id", "article.id" %}
|
||||
<p>Returns the id of an article.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.moderated?", "article-moderated?" %}
|
||||
<p>Returns <code>true</code> if the blog that the article belongs to is set to moderate comments. Returns <code>false</code> if the blog is not moderated.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.published_at", "article-published_at" %}
|
||||
<p>Returns the date/time when an article was published. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#date">date filter</a> to format the timestamp.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.tags", "article-tags" %}
|
||||
<p>Returns all the tags for an article.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for tag in article.tags %}
|
||||
{{tag}}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
tag1 tag2 tag3 tag4
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.title", "article-title" %}
|
||||
<p>Returns the title of an article.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.url", "article-url" %}
|
||||
<p>Returns the relative URL of the article.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ article.url }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
/blogs/news/10582441-my-new-article
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.user.account_owner", "article-user-account_owner" %}
|
||||
<p>Returns "true" if the author of the article is the account owner of the shop. Returns "false" if the author is not the account owner.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.user.bio", "article-user-bio" %}
|
||||
<p>Returns the bio of the author of an article. This is entered through the <strong>Staff members</strong> options on the <a href="http://www.shopify.com/admin/settings/account">Account</a> page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.user.email", "article-user-email" %}
|
||||
<p>Returns the email of the author of an article. This is entered through the <strong>Staff members</strong> options on the <a href="http://www.shopify.com/admin/settings/account">Account</a> page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.user.first_name", "article-user-first_name" %}
|
||||
<p>Returns the first name of the author of an article. This is entered through the <strong>Staff members</strong> options on the <a href="http://www.shopify.com/admin/settings/account">Account</a> page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.user.last_name", "article-user-last_name" %}
|
||||
<p>Returns the last name of the author of an article. This is entered through the <strong>Staff members</strong> options on the <a href="http://www.shopify.com/admin/settings/account">Account</a> page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "article.user.homepage", "article-user-homepage" %}
|
||||
<p>Returns the homepage of the author of an article. This is entered through the <strong>Staff members</strong> options on the <a href="http://www.shopify.com/admin/settings/account">Account</a> page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
152
documentation/objects/blog.md
Normal file
152
documentation/objects/blog.md
Normal file
@@ -0,0 +1,152 @@
|
||||
---
|
||||
layout: default
|
||||
title: blog
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# blog
|
||||
|
||||
The <code>blog</code> object has the following attributes:
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
{% anchor_link "blog.all_tags", "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.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for tag in blog.all_tags %}
|
||||
{{ tag }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
News, Music, Sale, Tips and Tricks
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.articles", "blog-articles" %}
|
||||
Returns an array of all articles in a blog. See <a href="/themes/liquid-documentation/objects/article/">this page</a> for a list of all available attributes for <code>article</code>.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for article in blog.articles %}
|
||||
<h2>{{ article.title }}</h2>
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<h2>Hello World!</h2>
|
||||
<h2>This is my second post.</h2>
|
||||
<h2>Third time's a charm!</h2>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.articles_count", "blog-articles_count" %}
|
||||
Returns the total number of articles in a blog. This total does not include hidden articles.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.comments_enabled?", "blog-comments_enabled?" %}
|
||||
Returns <code>true</code> if comments are enabled, or <code>false</code> if they are disabled.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.handle", "blog-handle" %}
|
||||
Returns the <a href="/themes/liquid-documentation/basics/handle/">handle</a> of the blog.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.id", "blog-id" %}
|
||||
Returns the id of the blog.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.moderated?", "blog-moderated?" %}
|
||||
Returns <code>true</code> if comments are moderated, or <code>false</code> if they are not moderated.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.next_article", "blog-next_article" %}
|
||||
Returns the URL of the next (older) post. Returns "false" if there is no next article.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.previous_article", "blog-previous_article" %}
|
||||
|
||||
Returns the URL of the previous (newer) post. Returns <code>false</code> if there is no next article.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.tags", "blog-tags" %}
|
||||
|
||||
Returns all tags in a blog. Similar to <a href="#blog.all_tags">all_tags</a>, but only returns tags of articles that are in the filtered view.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.title", "blog-title" %}
|
||||
|
||||
Returns the title of the blog.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "blog.url", "blog-url" %}
|
||||
|
||||
Returns the relative URL of the blog.
|
||||
|
||||
|
||||
|
||||
147
documentation/objects/cart.md
Normal file
147
documentation/objects/cart.md
Normal file
@@ -0,0 +1,147 @@
|
||||
---
|
||||
layout: default
|
||||
title: cart
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# cart
|
||||
|
||||
The <code>cart</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
{% anchor_link "cart.attributes", "cart-attributes" %}
|
||||
|
||||
<code>cart.attributes</code> allow the capturing of more information on the cart page. This is done by giving an input a <code>name</code>attribute with the following syntax:
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
attributes[attribute-name]
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
Shown below is a basic example of how to use an HTML input of type "text" to capture information on the cart page.
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<label>What is your Pet's name?</label>
|
||||
<input type="text" name="attributes[your-pet-name]" value="{{ cart.attributes.your-pet-name }}" />
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<code>cart.attributes</code> can be accessed in order email templates, the Thank You page of the checkout, as well as in apps such as <a href="http://docs.shopify.com/manual/more/official-shopify-apps/order-printer">Order Printer</a>.
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ attributes.your-pet-name }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Haku
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
For more examples on how to use cart attributes, see <a href="http://docs.shopify.com/manual/configuration/store-customization/communicating-with-customers/obtain-information/ask-customer-for-more-information#cart-attributes">Ask a customer for additional information</a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "cart.item_count", "cart-item_count" %}
|
||||
|
||||
<p>Returns the number of items inside the cart.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ cart.item_count }} {{ cart.item_count | pluralize: 'Item', 'Items' }} ({{ cart.total_price | money }})
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
25 Items ($53.00)
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "cart.items", "cart-items" %}
|
||||
|
||||
<p>Returns all of the <a href="/themes/liquid-documentation/objects/line_item/">line items</a> in the cart.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "cart.note", "cart-note" %}
|
||||
|
||||
<code>cart.note</code> allows the capturing of more information on the cart page.
|
||||
|
||||
This is done by submitting the cart form with an HTML <code>textarea</code> and wrapping the <code>cart.note</code> output.
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<label>Gift note:</label>
|
||||
<textarea rows="100" cols="20">{{ cart.note }}</textarea>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
{% block "note" %}
|
||||
There can only be one instance of <code>{% raw %}{{ cart.note }}{% endraw %}</code> on the cart page. If there are multiple instances, the one that comes latest in the Document Object Model (DOM) will be submitted with the form.
|
||||
{% endblock %}
|
||||
|
||||
<code>cart.note</code> can be accessed in order email templates, the Thank You page of the checkout, as well as in apps such as <a href="http://docs.shopify.com/manual/more/official-shopify-apps/order-printer">Order Printer</a>. For examples on how to use cart notes, see <a href="http://docs.shopify.com/manual/configuration/store-customization/communicating-with-customers/obtain-information/ask-customer-for-more-information#cart-note">Ask a customer for additional information</a>.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ note }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Hope you like the gift, Kylea!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "cart.total_price", "cart-total_price" %}
|
||||
|
||||
<p>Returns the total price of all of the items in the cart.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "cart.total_weight", "cart-total_weight" %}
|
||||
|
||||
<p>Returns the total weight of all of the items in the cart.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
455
documentation/objects/collection.md
Normal file
455
documentation/objects/collection.md
Normal file
@@ -0,0 +1,455 @@
|
||||
---
|
||||
layout: default
|
||||
title: collection
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# collection
|
||||
|
||||
The <code>collection</code> object has the following attributes:
|
||||
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% comment %}
|
||||
|
||||
Commenting out all_products and all_products_count as I don't see a purpose for them atm. The pagination limit for products and all_products is the same, so what is the difference?
|
||||
|
||||
{% anchor_link "collection.all_products", "collection.all_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 <a href="#">pagination</a> tag to control how many products are shown per page.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.all_products_count", "collection.all_products_count" %}
|
||||
|
||||
<p>Returns the number of products in a collection.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ collection.all_products_count }} {{ collection.all_products_count | pluralize: 'Item', 'Items' }} total
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
24 Items
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.all_tags", "collection.all_tags" %}
|
||||
|
||||
Returns all tags of all products of a collection. This includes tags of products that are not in the current pagination view.
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
{% if collection.all_tags.size > 0 %}
|
||||
{% for tag in collection.all_tags %}
|
||||
{% if current_tags contains tag %}
|
||||
<li class="active">
|
||||
{{ tag | link_to_remove_tag: tag }}
|
||||
</li>
|
||||
{% else %}
|
||||
<li>
|
||||
{{ tag | link_to_tag: tag }}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
|
||||
|
||||
# {% endcomment %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.all_types", "collection-all_types" %}
|
||||
|
||||
<p>Returns a list of all product types in a collection.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product_type in collection.all_types %}
|
||||
{{ product_type | link_to_type }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<a href="/collections/types?q=Accessories" title="accessories">Accessories</a>
|
||||
<a href="/collections/types?q=Chairs" title="Chairs">Chairs</a>
|
||||
<a href="/collections/types?q=Shoes" title="Shoes">Shoes</a>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.all_vendors", "collection-all_vendors" %}
|
||||
|
||||
<p>Returns a list of all product vendors in a collection.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product_vendor in collection.all_vendors %}
|
||||
{{ product_vendor | link_to_vendor }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<a href="/collections/vendors?q=Shopify" title="Shopify">Shopify</a>
|
||||
<a href="/collections/vendors?q=Shirt+Company" title="Shirt Company">Shirt Company</a>
|
||||
<a href="/collections/vendors?q=Montezuma" title="Montezuma">Montezuma</a>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.current_type", "collection-current_type" %}
|
||||
|
||||
Returns the product type when filtering a collection by type. For example, you may be on a collection page filtered by a type query parameter via this URL: <tt>myshop.shopify.com/collections?types=shirts</tt>.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if collection.current_type %}
|
||||
{{ collection.current_type }}
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
shirts
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.current_vendor", "collection-current_vendor" %}
|
||||
|
||||
Returns the vendor name when filtering a collection by vendor. For example, you may be on a collection page filtered by a vendor query parameter via this URL: <tt>myshop.shopify.com/collections/vendors?q=Shopify</tt>.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if collection.current_vendor %}
|
||||
{{ collection.current_vendor }}
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Shopify
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.default_sort_by", "collection-default_sort_by" %}
|
||||
|
||||
<p>Returns the sort order of the collection, which is set in the collection pages of the Admin.</p>
|
||||
|
||||
{{ '/themes/collection-sorting.jpg' | image }}
|
||||
|
||||
The possible outputs are:
|
||||
|
||||
- manual
|
||||
- best-selling
|
||||
- title-ascending
|
||||
- title-descending
|
||||
- price-ascending
|
||||
- price-descending
|
||||
- created-ascending
|
||||
- created-descending
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.description", "collection-description" %}
|
||||
|
||||
<p>Returns the description of the collection.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.handle", "collection-handle" %}
|
||||
|
||||
<p>Returns the <a href="/themes/liquid-documentation/basics/handle/">handle</a> of a collection. </p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.id", "collection-id" %}
|
||||
|
||||
<p>Returns the id of the collection.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.image", "collection-image" %}
|
||||
|
||||
<p>Returns the collection image. Use the <a href="/themes/liquid-documentation/filters/url-filters/#collection_img_url">collection_img_url</a> filter to link it to the image file on the Shopify CDN.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ collection.image | collection_img_url: 'medium' }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
//cdn.shopify.com/s/files/1/0087/0462/collections/collection-image_medium.png?v=1337103726
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% comment %}
|
||||
Commenting out since you can't actually change alt tag in admin.
|
||||
{% anchor_link "collection.image.alt", "collection.image.alt" %}
|
||||
|
||||
<p>Returns the collection image's alt tag.</p>
|
||||
|
||||
|
||||
{% endcomment %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.image.src", "collection-image-src" %}
|
||||
|
||||
<p>Returns the relative URL to the collection image.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ collection.image.src | collection_img_url: 'medium' }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
//cdn.shopify.com/s/files/1/0087/0462/collections/summer_collection_medium.png?v=1334084726
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.next_product", "collection-next_product" %}
|
||||
|
||||
Returns the URL of the next product in the collection. Returns <code>nil</code> if there is no next product.
|
||||
|
||||
This output can be used on the product page to output "next" and "previous" links on the <tt>product.liquid</tt> template. For more information, see <a href="http://docs.shopify.com/support/your-store/collections/how-to-navigate-within-a-collection">How to Navigate within a Collection</a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.previous_product", "collection-previous_product" %}
|
||||
|
||||
Returns the URL of the previous product in the collection. Returns <code>nil</code> if there is no previous product.
|
||||
|
||||
This output can be used on the product page to output "next" and "previous" links on the <tt>product.liquid</tt> template. For more information, see <a href="http://docs.shopify.com/support/your-store/collections/how-to-navigate-within-a-collection">How to Navigate within a Collection</a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.products", "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 <a href="/themes/liquid-documentation/tags/theme-tags/#paginate">pagination</a> tag to control how many products are shown per page.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.products_count", "collection-products_count" %}
|
||||
|
||||
<p>Returns the number of products in a collection.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ collection.all_products_count }} {{ collection.all_products_count | pluralize: 'Item', 'Items' }} total
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
24 Items
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.template_suffix", "collection-template_suffix" %}
|
||||
|
||||
<p>Returns the name of the custom collection template assigned to the collection, without the <tt>collection.</tt> prefix or the <tt>.liquid</tt> suffix. Returns <code>nil</code> if a custom template is not assigned to the collection.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ collection.template_suffix }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
no-price
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.title", "collection-title" %}
|
||||
|
||||
<p>Returns the title of the collection.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
<h1>{{ collection.title }}</h1>
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Frontpage
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.tags", "collection-tags" %}
|
||||
|
||||
<p>Returns all tags of all products in a collection.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "collection.url", "collection-url" %}
|
||||
|
||||
<p>Returns the URL of the collection.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
71
documentation/objects/comment.md
Normal file
71
documentation/objects/comment.md
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
layout: default
|
||||
title: comment
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# comment
|
||||
|
||||
The <code>comment</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
{% anchor_link "comment.id", "comment-id" %}
|
||||
|
||||
Returns the id (unique identifier) of the comment.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "comment.author", "comment-author" %}
|
||||
|
||||
Returns the author of the comment.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "comment.email", "comment-email" %}
|
||||
|
||||
Returns the e-mail address of the comment's author.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "comment.content", "comment-content" %}
|
||||
|
||||
Returns the content of the comment.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "comment.status", "comment-status" %}
|
||||
|
||||
Returns the status of the comment. The possible values are:
|
||||
|
||||
- unapproved
|
||||
- published
|
||||
- removed
|
||||
- spam
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "comment.url", "comment-url" %}
|
||||
|
||||
Returns the URL of the article with <code>comment.id</code> appended to it. This is so the page will automatically scroll to the comment.
|
||||
|
||||
|
||||
|
||||
|
||||
37
documentation/objects/country-option-tags.md
Normal file
37
documentation/objects/country-option-tags.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
layout: default
|
||||
title: country_option_tags
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# country_option_tags
|
||||
|
||||
<code>country_option_tags</code> creates an <option> tag for each country. An attribute named <code>data-provinces</code> is set for each country, containing JSON-encoded arrays of the country's respective subregions. If a country does not have any subregions, an empty array is set for its <code>data-provinces</code> attribute.
|
||||
|
||||
<code>country_option_tags</code> must be wrapped in <select> HTML tags.
|
||||
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
<select name="country">
|
||||
{{ country_option_tags }}
|
||||
</select>
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
{% highlight html %}
|
||||
<select name="country">
|
||||
<option value"" data-provinces="[]">- Please Select --</option>
|
||||
...
|
||||
...
|
||||
<option value="Canada" data-provinces="["Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon"]">Canada</option>
|
||||
<option value="China" data-provinces="[]">China</option>
|
||||
...
|
||||
...
|
||||
</select>
|
||||
{% endhighlight %}
|
||||
|
||||
26
documentation/objects/current-page.md
Normal file
26
documentation/objects/current-page.md
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
layout: default
|
||||
title: current_page
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# current_page
|
||||
|
||||
<code>current_page</code> returns the number of the page you are on when browsing through <a href="/themes/liquid-documentation/tags/theme-tags/#paginate">paginated</a> content. It can be used outside the <code>paginate</code> block.
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
{{ page_title }} - Page: {{ current_page }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Summer Collection - Page: 1
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
64
documentation/objects/current-tags.md
Normal file
64
documentation/objects/current-tags.md
Normal file
@@ -0,0 +1,64 @@
|
||||
---
|
||||
layout: default
|
||||
title: current_tags
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# 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. The <code>current_tags</code> variable is an array that contains all tags that are being used to filter a collection or blog.
|
||||
|
||||
{% block "note-information" %}
|
||||
Tags inside the current_tags array will always display in alphabetical order. It is not possible to manually change the order.
|
||||
{% endblock %}
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
{% anchor_link "Inside collection.liquid", "collection" %}
|
||||
|
||||
Inside collection.liquid, <code>current_tags</code> contains all <strong>product tags</strong> that are used to filter a collection.
|
||||
|
||||
The example below creates a list that displays every tag within every product in a collection. If the collection is filtered by the tag (i.e. if <code>current_tags</code> **does** contain the tag), the link will remove the filter. If the collection is not currently filtered by the tag (if <code>current_tags</code> **does not** contain the tag), a link will appear to allow the user to do so.
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
<ul>
|
||||
{% for tag in collection.all_tags %}
|
||||
{% if current_tags contains tag %}
|
||||
<li class="active">{{ tag | link_to_remove_tag: tag }}</li>
|
||||
{% else %}
|
||||
<li>{{ tag | link_to_add_tag: tag }}</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "Inside blog.liquid", "blog" %}
|
||||
|
||||
Inside blog.liquid, <code>current_tags</code> contains all <strong>article</strong> tags that are used to filter the blog.
|
||||
|
||||
The example below adds a breadcrumb that shows which article tag is being used to filter a blog. If there is a tag being used to filter a blog, the breadcrumb displays the tag name and provides a link back to the unfiltered blog.
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
{% if current_tags %}
|
||||
<h1>{{ blog.title | link_to: blog.url }} » {{ current_tags.first }}</h1>
|
||||
{% else %}
|
||||
<h1>{{ blog.title }}</h1>
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
|
||||
|
||||
|
||||
238
documentation/objects/customer-address.md
Normal file
238
documentation/objects/customer-address.md
Normal file
@@ -0,0 +1,238 @@
|
||||
---
|
||||
layout: default
|
||||
title: customer_address
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# customer_address
|
||||
|
||||
The <code>customer_address</code> contains information of addresses tied to a <a href="http://docs.shopify.com/manual/your-store/customers/customer-accounts">Customer Account</a>.
|
||||
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.first_name", "first-name" %}
|
||||
|
||||
Returns the value of the First Name field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.last_name", "last-name" %}
|
||||
|
||||
Returns the value of the Last Name field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.address1", "customer_address-address1" %}
|
||||
|
||||
Returns the value of the Address1 field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.address2", "customer_address-address2" %}
|
||||
|
||||
Returns the value of the Address2 field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.street", "street" %}
|
||||
|
||||
Returns the combined values of the Address1 and Address2 fields of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shipping_address.street }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
126 York St, Shopify Office
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.company", "company" %}
|
||||
|
||||
Returns the value of the Company field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.city", "city" %}
|
||||
|
||||
Returns the value of the City field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.province", "province" %}
|
||||
|
||||
Returns the value of the Province/State field of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ customer_address.province }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Ontario
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.province_code", "province_code" %}
|
||||
|
||||
Returns the abbreviated value of the Province/State field of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ billing_address.province_code }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
ON
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.zip", "zip" %}
|
||||
|
||||
Returns the value of the Postal/Zip field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.country", "country" %}
|
||||
|
||||
Returns the value of the Country field of the address.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ customer_address.country }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Japan
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.country_code", "country-code" %}
|
||||
|
||||
Returns the value of the Country field of the address in ISO 3166-2 standard format.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ customer_address.country_code }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
CA
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.phone", "phone" %}
|
||||
|
||||
Returns the value of the Phone field of the address.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer_address.id", "id" %}
|
||||
|
||||
Returns the id of customer address.
|
||||
273
documentation/objects/customer.md
Normal file
273
documentation/objects/customer.md
Normal file
@@ -0,0 +1,273 @@
|
||||
---
|
||||
layout: default
|
||||
title: customer
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# customers
|
||||
|
||||
<p>The <code>customer</code> object contains information of customers who have created a <a href="http://docs.shopify.com/manual/your-store/customers/customer-accounts">Customer Account</a>.</p>
|
||||
|
||||
<p><code>customer</code> can also be accessed in order email templates, the Thank You page of the checkout, as well as in apps such as <a href="http://docs.shopify.com/manual/more/official-shopify-apps/order-printer">Order Printer</a>.</p>
|
||||
|
||||
<a id="topofpage"></a>
|
||||
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.accepts_marketing", "customer-accepts_marketing" %}
|
||||
|
||||
<p>Returns <code>true</code> if the customer accepts marketing, returns <code>false</code> if the customer does not.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.addresses", "customer-addresses" %}
|
||||
|
||||
Returns an array of all of the customer addresses associated with a customer. See <a href="/themes/liquid-documentation/objects/customer-address/">customer_address</a> for a full list of available attributes.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for address in customer.addresses %}
|
||||
{{ address.street }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
126 York St, Suite 200 (Shopify Office)
|
||||
123 Fake St
|
||||
53 Featherston Lane
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.addresses_count", "customer-addresses_count" %}
|
||||
|
||||
<p>Returns the number of addresses associated with a customer.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.default_address", "customer-default_address" %}
|
||||
|
||||
<p>Returns the default <a href="/themes/liquid-documentation/objects/customer-address/">customer_address</a> of a customer.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.email", "customer-email" %}
|
||||
|
||||
<p>Returns the email address of the customer.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.first_name", "customer-first_name" %}
|
||||
|
||||
<p>Returns the first name of the customer.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.id", "customer-id" %}
|
||||
|
||||
<p>Returns the id of the customer.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.last_name", "customer-last_name" %}
|
||||
|
||||
<p>Returns the last name of the customer.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.last_order", "customer-last_order" %}
|
||||
|
||||
<p>Returns the last <a href="/themes/liquid-documentation/objects/order/">order </a> placed by the customer. </p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Your last order was placed on: {{ customer.last_order.created_at | date: "%B %d, %Y %I:%M%p" }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Your last order was placed on: April 25, 2014 01:49PM
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.name", "customer-name" %}
|
||||
|
||||
<p>Returns the full name of the customer.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.orders", "customer-orders" %}
|
||||
|
||||
<p>Returns an array of all <a href="/themes/liquid-documentation/objects/order/">orders</a> placed by the customer.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for order in customer.orders %}
|
||||
{{ order.id }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
#1088
|
||||
#1089
|
||||
#1090
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.orders_count", "customer-orders_count" %}
|
||||
|
||||
<p>Returns the total number of orders a customer has placed.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.recent_order", "customer-recent_order" %}
|
||||
|
||||
<p>Returns the most recent <a href="/themes/liquid-documentation/objects/order/">order </a> placed by the customer. </p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Your most recent order was placed on: {{ customer.recent_order.created_at | date: "%B %d, %Y %I:%M%p" }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Your last order was placed on: August 25, 2014 05:49PM
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.tags", "customer-tags" %}
|
||||
|
||||
Returns the list of tags associated with the customer.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for tag in customer.tags %}
|
||||
{{ tag }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
wholesale regular-customer VIP
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "customer.total_spent", "customer-total_spent" %}
|
||||
|
||||
<p>Returns the total amount spent on all orders.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
111
documentation/objects/discount.md
Normal file
111
documentation/objects/discount.md
Normal file
@@ -0,0 +1,111 @@
|
||||
---
|
||||
layout: default
|
||||
title: discount
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# discount
|
||||
|
||||
The <code>discount</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
{% anchor_link "discount.id", "discount.id" %}
|
||||
|
||||
Returns the id of the discount.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "discount.code", "discount-code" %}
|
||||
|
||||
Returns the code of the discount.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ discount.code }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
SPRING14
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "discount.amount", "discount-amount" %}
|
||||
|
||||
Returns the amount of the discount. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ discount.amount | money }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
$25
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "discount.savings", "discount-savings" %}
|
||||
|
||||
Returns the amount of the discount's savings. The negative opposite of <a href="#discount.amount">amount</a>. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ discount.savings | money }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
$-25
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "discount.type", "discount-type" %}
|
||||
|
||||
Returns the type of the discount. The possible values of <code>discount.type</code> are:
|
||||
|
||||
- FixedAmountDiscount
|
||||
- PercentageDiscount
|
||||
- ShippingDiscount
|
||||
|
||||
|
||||
252
documentation/objects/for-loops.md
Normal file
252
documentation/objects/for-loops.md
Normal file
@@ -0,0 +1,252 @@
|
||||
---
|
||||
layout: default
|
||||
title: forloop
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# forloop
|
||||
|
||||
The <code>forloop</code> object contains attributes of its parent <a href="/themes/liquid-documentation/tags/iteration-tags/#for">for</a> loop.
|
||||
|
||||
|
||||
{% block "note-information" %}
|
||||
The <code>forloop</code> object can only be used within <a href="/themes/liquid-documentation/tags/iteration-tags/#for">for</a> tags.
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
||||
<a id="topofpage"></a>
|
||||
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "forloop.first", "first" %}
|
||||
|
||||
Returns <code>true</code> if it's the first iteration of the for loop. Returns <code>false</code> if it is not the first iteration.
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product in collections.frontpage.products %}
|
||||
{% if forloop.first == true %}
|
||||
First time through!
|
||||
{% else %}
|
||||
Not the first time.
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
First time through!
|
||||
Not the first time.
|
||||
Not the first time.
|
||||
Not the first time.
|
||||
Not the first time.
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "forloop.index", "index" %}
|
||||
|
||||
Returns the current index of the for loop, starting at 1.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product in collections.frontpage.products %}
|
||||
{{ forloop.index }}
|
||||
{% endfor %}{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "forloop.index0", "index0" %}
|
||||
|
||||
Returns the current index of the for loop, starting at 0.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product in collections.frontpage.products %}
|
||||
{{ forloop.index }}
|
||||
{% endfor %}{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "forloop.last", "last" %}
|
||||
|
||||
Returns <code>true</code> if it's the last iteration of the for loop. Returns <code>false</code> if it is not the last iteration.
|
||||
|
||||
|
||||
<p class="input">Input</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product in collections.frontpage.products %}
|
||||
{% if forloop.last == true %}
|
||||
This is the last iteration!
|
||||
{% else %}
|
||||
Keep going...
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Keep going...
|
||||
Keep going...
|
||||
Keep going...
|
||||
Keep going...
|
||||
Keep going...
|
||||
This is the last iteration!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "forloop.rindex", "rindex" %}
|
||||
|
||||
Returns <a href="#index">forloop.index</a> in reverse order.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product in collections.frontpage.products %}
|
||||
{{ forloop.rindex }}
|
||||
{% endfor %}{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "forloop.rindex0", "rindex0" %}
|
||||
|
||||
Returns <a href="#index0">forloop.index0</a> in reverse order.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product in collections.frontpage.products %}
|
||||
{{ forloop.rindex0 }}
|
||||
{% endfor %}{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "forloop.length", "length" %}
|
||||
|
||||
<p>Returns the number of iterations of the for loop.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- if collections.frontpage.products contains 10 products -->
|
||||
{% for product in collections.frontpage.products %}
|
||||
{% capture length %}{{ forloop.length }}{% endcapture %}
|
||||
{% endfor %}
|
||||
|
||||
{{ length }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
10
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
128
documentation/objects/form.md
Normal file
128
documentation/objects/form.md
Normal file
@@ -0,0 +1,128 @@
|
||||
---
|
||||
layout: default
|
||||
title: form
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# form
|
||||
|
||||
The <code>form</code> object is used within the <a href="/themes/liquid-documentation/tags/theme-tags/#form">form</a> tag. It contains attributes of its parent form.
|
||||
|
||||
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "form.author", "form-author" %}
|
||||
|
||||
<p>Returns the name of the author of the blog article comment. Exclusive to <code>form</code> tags with the "article" parameter.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "form.body", "form-body" %}
|
||||
|
||||
<p>Returns the content of the blog article comment. Exclusive to <code>form</code> tags with the "article" parameter.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "form.email", "form-email" %}
|
||||
|
||||
<p>Returns the email of the blog article comment's author. Exclusive to <code>form</code> tags with the "article" parameter.</p>
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "form.errors", "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. Possible values are:
|
||||
|
||||
- author
|
||||
- body
|
||||
- email
|
||||
- form
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for error in form.errors %}
|
||||
{{ error }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- if the Name field was left empty by the user -->
|
||||
author
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
You can apply the <a href="/themes/liquid-documentation/filters/additional-filters/#default_errors">default_errors</a> filter on <code>form.errors</code> to output default error messages without having to loop through the array.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if form.errors %}
|
||||
{{ form.errors | default_errors }}
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Please enter a valid email address.
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "form.posted_successfully?", "form-posted_successfully" %}
|
||||
|
||||
<p>Returns <code>true</code> if a comment by the user was submitted successfully, or <code>false</code> if the form contained errors.</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if form.posted_successfully? %}
|
||||
Comment posted successfully!
|
||||
{% else %}
|
||||
{{ form.errors | default_errors }}
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
93
documentation/objects/fulfillment.md
Normal file
93
documentation/objects/fulfillment.md
Normal file
@@ -0,0 +1,93 @@
|
||||
---
|
||||
layout: default
|
||||
title: fulfillment
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# fulfillment
|
||||
|
||||
The <code>fulfillment</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
{% comment %} Commenting out as this doesn't actually work.
|
||||
|
||||
{% anchor_link "fulfillment.created_at", "fulfillment.created_at" %}
|
||||
|
||||
<p>Returns the date the fulfillment was created at.</p>
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Fulfilled {{ line_item.fulfillment.created_at | date: "%b %d" }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% endcomment %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "fulfillment.tracking_company", "fulfillment-tracking_company" %}
|
||||
|
||||
<p>Returns the name of the fulfillment service.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "fulfillment.tracking_number", "fulfillment-tracking_number" %}
|
||||
|
||||
<p>Returns the tracking number for a fulfillment if it exists.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Tracking Number: {{ line_item.fulfillment.tracking_number }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Tracking Number: 1Z5F44813600X02768
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "fulfillment.tracking_url", "fulfillment-tracking_url" %}
|
||||
|
||||
<p>Returns the URL for a tracking number.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ fulfillment.tracking_url }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
http://wwwapps.ups.com/etracking/tracking.cgi?InquiryNumber1=1Z5F44813600X02768&TypeOfInquiryNumber=T&AcceptUPSLicenseAgreement=yes&submit=Track
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
162
documentation/objects/gift-card.md
Normal file
162
documentation/objects/gift-card.md
Normal file
@@ -0,0 +1,162 @@
|
||||
---
|
||||
layout: default
|
||||
title: gift_card
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# gift_card
|
||||
|
||||
The <code>gift_card</code> object can be accessed in the following templates:
|
||||
|
||||
1. The Gift Card Notification email notification template [Email Notifications > Gift Card Notification](http://shopify.com/admin/settings/notifications)
|
||||
|
||||
2. The [**gift_card.liquid**](/themes/theme-development/templates/gift-cards-liquid/) template.
|
||||
|
||||
The <code>gift_card</code> variable has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.balance", "gift_card-balance" %}
|
||||
|
||||
<p>Returns the amount of money remaining on the gift card.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.code", "gift_card-code" %}
|
||||
|
||||
<p>Returns the code that was used to redeem the gift card.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.currency", "gift_card-currency" %}
|
||||
|
||||
<p>Returns the currency that the card was issued in.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.customer", "gift_card-customer" %}
|
||||
|
||||
Returns the <a href="/themes/liquid-documentation/objects/customer/">customer</a> variable of the customer that the gift card is assigned to.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Hey, {{ gift_card.customer.first_name }}!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Hey, John!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.enabled", "gift_card-enabled" %}
|
||||
|
||||
<p>Returns <code>true</code> if the card is enabled, or <code>false</code> if the card is disabled.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.expired", "gift_card-expired" %}
|
||||
|
||||
<p>Returns <code>true</code> if the card is expired, or <code>false</code> if the card is not.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.expires_on", "gift_card-expires_on" %}
|
||||
|
||||
<p>Returns the expiration date of the gift card</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.initial_value", "gift_card-initial_value" %}
|
||||
|
||||
<p>Returns the initial amount of money on the gift card.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.properties", "gift_card-properties" %}
|
||||
|
||||
<p>Returns the <a href="http://docs.shopify.com/support/your-store/products/how-do-I-collect-additional-information-on-the-product-page-Like-for-a-monogram-engraving-or-customization">line item properties</a> assigned to the gift card when it was added to the cart.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "gift_card.url", "gift_card-url" %}
|
||||
|
||||
<p>Returns the unique URL that links to the gift card's page on the shop (rendered through <strong>gift_card.liquid</strong>).</p>
|
||||
|
||||
|
||||
|
||||
|
||||
112
documentation/objects/image.md
Normal file
112
documentation/objects/image.md
Normal file
@@ -0,0 +1,112 @@
|
||||
---
|
||||
layout: default
|
||||
title: image
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# image
|
||||
|
||||
The <code>image</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "image.alt", "image-alt" %}
|
||||
|
||||
<p>Returns the alt tag of the image, set in the <a href="http://docs.shopify.com/support/your-store/products/can-i-add-alt-text-to-my-product-images">Products</a> page of the Admin.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "image.id", "image-id" %}
|
||||
|
||||
Returns the id of the image.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "image.product_id", "image-product_id" %}
|
||||
|
||||
Returns the id of the image's product.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "image.position", "image-position" %}
|
||||
|
||||
Returns the position of the image, starting at 1. This is the same as outputting <a href="/themes/liquid-documentation/objects/for-loops/#index">forloop.index</a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "image.src", "image-src" %}
|
||||
|
||||
Returns the relative path of the product image. This is the same as outputting <code>{{ image }}</code>.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for image in product.images %}
|
||||
{{ image.src }}
|
||||
{{ image }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
products/my_image.jpg
|
||||
products/my_image.jpg
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
To return the URL of the image on Shopify's Content Delivery Network (CDN), use the appropriate <a href="/themes/liquid-documentation/filters/url-filters">URL filter</a>.
|
||||
|
||||
To see a full list of available image sizes, see <a href="/themes/liquid-documentation/filters/url-filters/#size-parameters">image size parameters</a>.
|
||||
|
||||
Shown below is an example of loading a product image using the <code>product_img_url</code> filter.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ image | product_img_url: "medium" }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
//cdn.shopify.com/s/files/1/0087/0462/products/shirt14_medium.jpeg?v=1309278311
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
235
documentation/objects/index.md
Normal file
235
documentation/objects/index.md
Normal file
@@ -0,0 +1,235 @@
|
||||
---
|
||||
layout: default
|
||||
title: Objects
|
||||
landing_as_article: true
|
||||
|
||||
nav:
|
||||
group: Liquid Documentation
|
||||
weight: 2
|
||||
---
|
||||
|
||||
# Objects
|
||||
|
||||
Liquid objects contain attributes to output dynamic content on the page. For example, the <code>product</code> object contains an attribute called <code>title</code> that can be used to output the title of a product.
|
||||
|
||||
**Liquid objects** are also often refered to as **Liquid variables**.
|
||||
|
||||
To output an object's attribute on the page, wrap them in <code>{{</code> and <code>}}</code>, as shown below:
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
{{ product.title }} <!-- Output: “Awesome Shoes” -->
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
|
||||
<h2 id='global-objects'>Global Objects</h2>
|
||||
|
||||
The following objects can be used and accessed from **any file** in your theme, and are defined as **global objects**, or global variables:
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><pre>blogs</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<ul>
|
||||
{% for article in blogs.myblog.articles %}
|
||||
<li>{{ article.title | link_to: article.url }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>blogs</code> refers to the blogs in your shop. <a href="/themes/liquid-documentation/objects/blog">More info ›</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>cart</pre></td>
|
||||
<td>
|
||||
<div></div>
|
||||
<p>The liquid object <code>cart</code> refers to the cart in your shop. <a href="/themes/liquid-documentation/objects/cart">More info ›</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>collections</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product in collections.frontpage.products %}
|
||||
{{ product.title }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>collections</code> contains a list of all of the collections in a shop. <a href="/themes/liquid-documentation/objects/collection">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>current_page</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if current_page != 1 %} Page {{ current_page }}{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The <code>current_page</code> object returns the number of the page you are on when browsing through paginated content. <a href="/themes/liquid-documentation/objects/current-page">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>current_tags</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- in blog.liquid -->
|
||||
{% if current_tags %}
|
||||
<h1>{{ blog.title | link_to: blog.url }} › {{ current_tags.first }}</h1>
|
||||
{% else %}
|
||||
<h1>{{ blog.title }}</h1>
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The <code>current_tags</code> object will contain a different list of tags depending on the type of template that is rendered. <a href="/themes/liquid-documentation/objects/current-tags">More info ›</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>customer</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if shop.customer_accounts_enabled %}
|
||||
{% if customer %}
|
||||
<a href="/account">My Account</a>
|
||||
{{ 'Log out' | customer_logout_link }}
|
||||
{% else %}
|
||||
{{ 'Log in' | customer_login_link }}
|
||||
{% if shop.customer_accounts_optional %}
|
||||
{{ 'Create an account' | customer_register_link }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>customer</code> is only defined when a customer is logged-in to the store. <a href="/themes/liquid-documentation/objects/customer">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>linklists</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<ul>
|
||||
{% for link in linklists.categories.links %}
|
||||
<li>{{ link.title | link_to: link.url }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endraw %}{% endhighlight%}
|
||||
</div>
|
||||
<p>The liquid object <code>linklists</code> contains a collection of all of the links in your shop. You can access a linklist by calling its handle on linklists. <a href="/themes/liquid-documentation/objects/linklist">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>pages</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<h1>{{ pages.about.title }}</h1>
|
||||
<p>{{ pages.about.author }} says...</p>
|
||||
<div>{{ pages.about.content }}</div>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>pages</code> refers to all of the pages in your shop. <a href="/themes/liquid-documentation/objects/page">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>page_description</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if page_description %}
|
||||
<meta name="description" content="{{ page_description }}" />
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>Merchants can specify a <code>page_description</code>. That field is automatically populated with the product/collection/article description. <a href="/themes/liquid-documentation/objects/page-description">More info ›</a>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>page_title</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ page_title }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>page_title</code> returns the title of the current page. <a href="/themes/liquid-documentation/objects/page-title">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>shop</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
</div>
|
||||
<p>The liquid object <code>shop</code> returns information about your shop. <a href="/themes/liquid-documentation/objects/shop">More info ›</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>template</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if template contains 'product' %}
|
||||
WE ARE ON A PRODUCT PAGE.
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>template</code> returns the name of the template used to render the current page, with the .liquid extension omitted. As a best practice, it is recommended that you use the template object as a body class. <a href="/themes/liquid-documentation/objects/template">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>settings</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if settings.use_logo %}
|
||||
{{ 'logo.png' | asset_url | img_tag: shop.name }}
|
||||
{% else %}
|
||||
<span class="no-logo">{{ shop.name }}</span>
|
||||
{% endif %}
|
||||
{% if settings.featured_collection and settings.featured_collection != '' and collections[settings.featured_collection].handle == settings.featured_collection and collections[settings.featured_collection].products_count > 0 %}
|
||||
{% for product in collections[settings.featured_collection].products %}
|
||||
{% include 'product-loop' %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>settings</code> gives you access to all of the theme settings. <a href="/themes/theme-development/templates/settings#settings-object">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><pre>theme</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Go to your <a href="/admin/themes/{{ theme.id }}/settings">theme settings</a>.
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>theme</code> represents the currently active theme. <a href="/themes/liquid-documentation/objects/theme">More info ›</a></p></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><pre>themes</pre></td>
|
||||
<td>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
We have a beautiful mobile theme, it's called {{ themes.mobile.name | link_to_theme: "mobile" }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
<p>The liquid object <code>themes</code> provides access to the shop's published themes. <a href="/themes/liquid-documentation/objects/theme">More info ›</a></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
238
documentation/objects/line_item.md
Normal file
238
documentation/objects/line_item.md
Normal file
@@ -0,0 +1,238 @@
|
||||
---
|
||||
layout: default
|
||||
title: line_item
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# line_item
|
||||
|
||||
A <strong>line item</strong> represents a single line in the shopping cart. There is one line item for each distinct product variant in the cart.
|
||||
|
||||
The <code>line_item</code> object can be accessed in all Liquid templates, as well as in notification email templates, the Thank You page of the checkout, as well as in apps such as [Order Printer](http://docs.shopify.com/manual/more/official-shopify-apps/order-printer).
|
||||
|
||||
The <code>line_item</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.id", "line-id" %}
|
||||
|
||||
Returns the id of the line item, which is the same as the id of its [variant](/themes/liquid-documentation/objects/variant/).
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.product", "product" %}
|
||||
|
||||
Returns the [product](/themes/liquid-documentation/objects/product/) of the line item.
|
||||
|
||||
Example for getting a line item's image:
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
{{ line_item.product.featured_image | product_img_url | img_tag }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.variant", "variant" %}
|
||||
|
||||
Returns the [variant](/themes/liquid-documentation/objects/variant/) of the line item.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.title", "title" %}
|
||||
|
||||
Returns the title of this line item. <code>line_item.title</code> combines both the line item's <code>product.title</code> and the line item's <code>variant.title</code>, separated by a hyphen.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ line_item.title }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Balloon Shirt - Medium
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
To output just the product title or variant title, you can access the <code>title</code> of the respective variables.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Product Title: {{ line_item.product.title }}
|
||||
Variant Title: {{ line_item.variant.title }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Product Title: Balloon Shirt
|
||||
Variant Title: Medium
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.price", "price" %}
|
||||
|
||||
Returns the price of the line item's variant.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.line_price", "line-price" %}
|
||||
|
||||
Returns the combined price of all the items in the line_item. This is the equivalent of <code>line_item.price</code> times <code>line_item.quantity</code>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.quantity", "quantity" %}
|
||||
|
||||
Returns the quantity of the line item.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.grams", "grams" %}
|
||||
|
||||
Returns the weight of the line item. Use the [weight_with_unit](/themes/liquid-documentation/filters/additional-filters/#weight_with_unit) filter to format the weight.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.sku", "sku" %}
|
||||
|
||||
Returns the SKU of the line item's variant.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.vendor", "vendor" %}
|
||||
|
||||
Returns the vendor name of the line item's product.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.requires_shipping", "requires-shipping" %}
|
||||
|
||||
Returns <code>true</code> if the line item requires shipping, or <code>false</code> if it does not. This is set in the variant options in the Products page of the Admin.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.variant_id", "variant-id" %}
|
||||
|
||||
Returns the id of the line item's variant.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.product_id", "product-id" %}
|
||||
|
||||
Returns the id of the line item's product.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "line_item.fulfillment", "fulfillment" %}
|
||||
|
||||
Returns the [fulfillment](/themes/liquid-documentation/objects/fulfillment/) of the line item.
|
||||
|
||||
|
||||
|
||||
|
||||
107
documentation/objects/link.md
Normal file
107
documentation/objects/link.md
Normal file
@@ -0,0 +1,107 @@
|
||||
---
|
||||
layout: default
|
||||
title: link
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# link
|
||||
|
||||
The <code>link</code> object cannot be invoked on its own. It must be invoked inside a <a href="/themes/liquid-documentation/objects/linklist/">linklist</a>.
|
||||
|
||||
The <code>link</code> object has the following attributes:
|
||||
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
{% anchor_link "link.active", "link-active" %}
|
||||
|
||||
<p>Returns <code>true</code> if the link is active, or <code>false</code> if the link is inactive.</p>
|
||||
|
||||
<p>If you are on a product page that is <a href="/themes/liquid-documentation/filters/url-filters/#within">collection-aware</a>, <code>link.active</code>will return <code>true</code> for both the collection-aware product URL and the collection-agnostic URL. For example, if you have a link whose URL points to:</p>
|
||||
|
||||
<div>{% highlight html %}{% raw %}
|
||||
/products/awesome-product
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p><code>link.active</code> will return <code>true</code> for the following URL, which links to the same product but through a collection:
|
||||
|
||||
<div>{% highlight html %}{% raw %}
|
||||
/collections/awesome-collection/products/awesome-product
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p>If you are on a collection page filtered with tags, and the link points to the unfiltered collection page, <code>link.active</code> will return <code>true</code>.</p>
|
||||
|
||||
<p>If you are on an article page and your link points to the blog, <code> link.active</code> will return <code>true</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "link.object", "link-object" %}
|
||||
|
||||
Returns the variable associated to the link. The type of variable that is returned is dependent on the value of <strong>Links To</strong> field of the link. The possible types are:
|
||||
|
||||
- <a href="/themes/liquid-documentation/objects/product/">product</a>
|
||||
- <a href="/themes/liquid-documentation/objects/collection/">collection</a>
|
||||
- <a href="/themes/liquid-documentation/objects/page/">page</a>
|
||||
- <a href="/themes/liquid-documentation/objects/blog/">blog</a>
|
||||
|
||||
Through <code>link.object</code>, you can access any of the attributes that are available in the above three variables.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
<!-- If the product links to a product with a price of $10 -->
|
||||
{{ link.object.price | money }}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
$10
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "link.title", "link-title" %}
|
||||
|
||||
<p>Returns the title of the link.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "link.type", "link-type" %}
|
||||
|
||||
Returns the type of the link. The possible values are:
|
||||
|
||||
- <strong>collection_link</strong>: if the link points to a collection
|
||||
- <strong>product_link</strong>: if the link points to a product page
|
||||
- <strong>page_link</strong>: if the link points to a page
|
||||
- <strong>blog_link</strong>: if the link points to a blog
|
||||
- <strong>relative_link</strong>: if the link points to the search page, the home page or /collections/all
|
||||
- <strong>http_link</strong>: if the link points to an external web page, or a type or vendor collection (ex: /collections/types?q=Pants)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "link.url", "link-url" %}
|
||||
|
||||
<p>Returns the URL of the link.</p>
|
||||
|
||||
|
||||
80
documentation/objects/linklist.md
Normal file
80
documentation/objects/linklist.md
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
layout: default
|
||||
title: linklist
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# linklist
|
||||
|
||||
|
||||
The <code>linklist</code> object has the following attributes:
|
||||
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "linklist.handle", "linklist-handle" %}
|
||||
|
||||
<p>Returns the <a href="/themes/liquid-documentation/basics/handle/">handle</a> of the linklist.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "linklist.id", "linklist-id" %}
|
||||
|
||||
<p>Returns the id of the linklist.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "linklist.links", "linklist-links" %}
|
||||
|
||||
<p>Returns an array of <a href="/themes/liquid-documentation/objects/link/">links</a> in the linklist.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for link in linklists.main-menu.links %}
|
||||
<a href="{{ link.url }}">{{ link.title }}</a>
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<a href="/">Home</a>
|
||||
<a href="/collections/all">Catalog</a>
|
||||
<a href="/blogs/news">Blog</a>
|
||||
<a href="/pages/about-us">About Us</a>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "linklist.title", "linklist-title" %}
|
||||
|
||||
<p>Returns the title of the linklist.</p>
|
||||
|
||||
|
||||
100
documentation/objects/metafield.md
Normal file
100
documentation/objects/metafield.md
Normal file
@@ -0,0 +1,100 @@
|
||||
---
|
||||
layout: default
|
||||
title: metafield
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# metafields
|
||||
|
||||
The <code>metafields</code> object allows you to store additional information for products, collections, orders, blogs, pages and your shop. You can output metafields on your storefront using Liquid.
|
||||
|
||||
There are several Shopify apps and browser add-ons that make use of the [Shopify API](/api/metafield) to let you manage your metafields:
|
||||
|
||||
* [Shopify FD](http://shopify.freakdesign.com.au/#ShopifyFD) to create and edit metafields
|
||||
* [Custom Fields](http://shopify.freakdesign.com.au/#customfields) to edit your metafields
|
||||
* [Metafields Editor](http://apps.shopify.com/metafields-editor)
|
||||
* [Metafields2](http://apps.shopify.com/metafields2)
|
||||
|
||||
A metafield consists of a namespace, a key, a value, and a description (optional). Use the namespace to group different metafields together in a logical way.
|
||||
|
||||
You can also specify metafields as either integers or strings. That way, you’ll end up with the right type of data when you use the metafields in your Liquid.
|
||||
|
||||
For example, if you’ve added two metafields to a product, and each metafield has the following attributes:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Namespace</th>
|
||||
<th>Key</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>instructions</td>
|
||||
<td>Wash</td>
|
||||
<td>Cold</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>instructions</td>
|
||||
<td>Dry</td>
|
||||
<td>Tumble</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
You can then use the following Liquid in <tt>product.liquid</tt> to output your metafield:
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}
|
||||
{% raw %}
|
||||
{% assign instructions = product.metafields.instructions %}
|
||||
{% assign key = 'Wash' %}
|
||||
<ul>
|
||||
<li>Wash: {{ instructions[key] }}</li>
|
||||
<li>Wash: {{ instructions['Wash'] }}</li>
|
||||
<li>Wash: {{ instructions.Wash }}</li>
|
||||
</ul>
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
{% highlight html %}
|
||||
Wash: Cold
|
||||
Wash: Cold
|
||||
Wash: Cold
|
||||
{% endhighlight %}
|
||||
|
||||
You can use the following in <tt>product.liquid</tt> to output your second metafield:
|
||||
|
||||
{% highlight html %}
|
||||
{% raw %}
|
||||
{% assign instructions = product.metafields.instructions %}
|
||||
{% assign key = 'Dry' %}
|
||||
<ul>
|
||||
<li>Dry: {{ instructions[key] }}</li>
|
||||
<li>Dry: {{ instructions['Dry'] }}</li>
|
||||
<li>Dry: {{ instructions.Dry }}</li>
|
||||
</ul>
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
If you need to output all metafields with the namespace _instructions_ attached to a given product, use the following Liquid:
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}
|
||||
{% raw %}
|
||||
<ul>
|
||||
{% for field in product.metafields.instructions %}
|
||||
<li>{{ field | first }}: {{ field | last }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endraw %}
|
||||
{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
{% highlight html %}
|
||||
Wash: Cold
|
||||
Dry: Tumble
|
||||
{% endhighlight %}
|
||||
|
||||
The key of a metafield is <code>{% raw %}{{ field | first }}{% endraw %}</code>, while the value is <code>{% raw %}{{ field | last }}{% endraw %}</code>.
|
||||
349
documentation/objects/order.md
Normal file
349
documentation/objects/order.md
Normal file
@@ -0,0 +1,349 @@
|
||||
---
|
||||
layout: default
|
||||
title: order
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# order
|
||||
|
||||
The <code>order</code> object can be accessed in order email templates, the Thank You page of the checkout, as well as in apps such as <a href="http://docs.shopify.com/manual/more/official-shopify-apps/order-printer">Order Printer</a>.
|
||||
|
||||
The <code>order</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
{% anchor_link "order.billing_address", "order-billing_address" %}
|
||||
|
||||
Returns the billing <a href="/themes/liquid-documentation/objects/address/">address</a> of the order.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.cancelled", "order-cancelled" %}
|
||||
|
||||
<p>Returns <code>true</code> if an order is cancelled, returns <code>false</code>if it not.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.cancelled_at", "order-cancelled_at" %}
|
||||
|
||||
<p>Returns the timestamp of when an order was cancelled. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#date">date</a> filter to format the timestamp.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.cancel_reason", "order-cancel_reason" %}
|
||||
|
||||
<p>Returns the cancellation reason of an order, if it was cancelled.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.created_at", "order-created_at" %}
|
||||
|
||||
<p>Returns the timestamp of when an order was created. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#date">date</a> filter to format the timestamp.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.customer", "order-customer" %}
|
||||
|
||||
<p>Returns the <a href="/themes/liquid-documentation/objects/customer/">customer</a> associated to the order.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.customer_url", "order-customer_url" %}
|
||||
|
||||
<p>Returns the URL of the customer's account page.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
{{ order.name | link_to: order.customer_url }}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
http://john-apparel.myshopify.com/account/orders/d94ec4a1956f423dc4907167c9ef0413
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.discounts", "order-discounts" %}
|
||||
|
||||
<p>Returns an array of <a href="/themes/liquid-documentation/objects/discount/">discounts</a> for an order.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
{% for discount in order.discounts %}
|
||||
Code: {{ discount.code }}
|
||||
Savings: {{ discount.savings | money }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
Code: SUMMER2014
|
||||
Savings: -€50
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.email", "order-email" %}
|
||||
|
||||
<p>Returns the email associated with an order.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.financial_status", "order-financial_status" %}
|
||||
|
||||
<p>Returns the financial status of an order. The possible values are:</p>
|
||||
|
||||
- pending
|
||||
- authorized
|
||||
- paid
|
||||
- partially_paid
|
||||
- refunded
|
||||
- partially_refunded
|
||||
- voided
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.fulfillment_status", "order-fulfillment_status" %}
|
||||
|
||||
<p>Returns the fulfillment status of an order.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.line_items", "order-line_items" %}
|
||||
|
||||
<p>Returns an array of <a href="/themes/liquid-documentation/objects/line_item/">line items</a> from the order.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.location", "order-location" %}
|
||||
|
||||
<p><strong>POS Only</strong>. Displays the physical location of the order. You can configure locations in the <a href="http://shopify.com/admin/settings/locations">Locations settings</a> of the admin.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.name", "order-name" %}
|
||||
|
||||
Returns the name of the order, in the format set in the <strong>Standards & formats</strong> section of the <a href="/admin/settings/general">General Settings</a>.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
{{ order.name }}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
#1025
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.order_number", "order-order_number" %}
|
||||
|
||||
<p>Returns the integer representation of the order name.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
{{ order.order_number }}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
1025
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.shipping_address", "order-shipping_address" %}
|
||||
|
||||
Returns the shipping <a href="/themes/liquid-documentation/objects/address/">address</a> of the order.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.shipping_methods", "order-shipping_methods" %}
|
||||
|
||||
Returns an array of <a href="/themes/liquid-documentation/objects/shipping_method/">shipping_method</a> variables from the order.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.shipping_price", "order-shipping_price" %}
|
||||
|
||||
<p>Returns the shipping price of an order. Use a <a href="/themes/liquid-documentation/filters/money-filters/">money filter</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.subtotal_price", "order-subtotal_price" %}
|
||||
|
||||
<p>Returns the subtotal price of an order. Use a <a href="/themes/liquid-documentation/filters/money-filters/">money filter</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.tax_lines", "order-tax_lines" %}
|
||||
|
||||
<p>Returns an array of <a href="/themes/liquid-documentation/objects/tax_line/">tax_line</a> variables for an order.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
{% for tax_line in order.tax_lines %}
|
||||
Tax ({{ tax_line.title }} {{ tax_line.rate | times: 100 }}%):
|
||||
{{ tax_line.price | money }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
Tax (GST 14.0%): $25
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.tax_price", "order-tax_price" %}
|
||||
|
||||
<p>Returns the order's tax price. Use a <a href="/themes/liquid-documentation/filters/money-filters/">money filter</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.total_price", "order-total_price" %}
|
||||
|
||||
<p>Returns the total price of an order. Use a <a href="/themes/liquid-documentation/filters/money-filters/">money filter</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "order.transactions", "order-transactions" %}
|
||||
|
||||
<p>Returns an array of <a href="/themes/liquid-documentation/objects/transaction/">transactions</a> from the order.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
38
documentation/objects/page-description.md
Normal file
38
documentation/objects/page-description.md
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
layout: default
|
||||
title: page_description
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# page_description
|
||||
|
||||
Returns the description of a **Product**, **Page**, or **Blog Article**, set in their respective Admin pages.
|
||||
|
||||
{{ '/themes/page_desc.jpg' | image }}
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ page_description }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
This is my About Us page!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
39
documentation/objects/page-title.md
Normal file
39
documentation/objects/page-title.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
layout: default
|
||||
title: page_title
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# page_title
|
||||
|
||||
Returns the title of a **Product**, **Page**, or **Blog Article**, set in their respective Admin pages.
|
||||
|
||||
{{ '/themes/page_title.jpg' | image }}
|
||||
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ page_title }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
About Us
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
146
documentation/objects/page.md
Normal file
146
documentation/objects/page.md
Normal file
@@ -0,0 +1,146 @@
|
||||
---
|
||||
layout: default
|
||||
title: page
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# page
|
||||
|
||||
The <code>page</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.author", "page.author" %}
|
||||
|
||||
<p>Returns the author of a page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.content", "page-content" %}
|
||||
|
||||
<p>Returns the content of a page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.handle", "page-handle" %}
|
||||
|
||||
<p>Returns the <a href="/themes/liquid-documentation/basics/handle/">handle</a> of the page. </p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.id", "page-id" %}
|
||||
|
||||
<p>Returns the id of the page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.published_at", "page-published_at" %}
|
||||
|
||||
Returns the timestamp of when the page was created. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#date">date</a> filter to format the timestamp.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.template_suffix", "page-template_suffix" %}
|
||||
|
||||
Returns the name of the custom page template assigned to the page, without the <code>page.</code> prefix nor the <code>.liquid</code> suffix. Returns <code>nil</code> if a custom template is not assigned to the page.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- on page.contact.liquid -->
|
||||
{{ page.template_suffix }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
contact
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.title", "page-title" %}
|
||||
|
||||
<p>Returns the title of a page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "page.url", "page-url" %}
|
||||
|
||||
<p>Returns the relative URL of the page.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ page.url }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
/pages/about-us
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
161
documentation/objects/paginate.md
Normal file
161
documentation/objects/paginate.md
Normal file
@@ -0,0 +1,161 @@
|
||||
---
|
||||
layout: default
|
||||
title: paginate
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# paginate
|
||||
|
||||
The <a href="/themes/liquid-documentation/tags/theme-tags/#paginate">paginate</a> tag's navigation is built using the attributes of the <code>paginate</code> object. You can also use the <a href="/themes/liquid-documentation/filters/additional-filters/#default_pagination">default_pagination</a> filter for a quicker alternative.
|
||||
|
||||
{% block "note-information" %}
|
||||
The <code>paginate</code> object can only be used within <a href="/themes/liquid-documentation/tags/theme-tags/#paginate">paginate</a> tags.
|
||||
{% endblock %}
|
||||
|
||||
|
||||
The <code>paginate</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.current_page", "paginate-current_page" %}
|
||||
|
||||
<p>Returns the number of the current page.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.current_offset", "paginate-current_offset" %}
|
||||
|
||||
<p>Returns the total number of items that are on the pages previous to the current one. For example, if you are paginating by 5 and are on the third page, <code>paginate.current_offset</code> would return <code>10</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.items", "paginate-items" %}
|
||||
|
||||
<p>Returns the total number of items to be paginated. For example, if you are paginating a collection of 120 products, <code>paginate.items</code> would return <code>120</code>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.parts", "paginate-parts" %}
|
||||
|
||||
<p>Returns an array of all <a href="/themes/liquid-documentation/objects/part/">parts</a> of the pagination. A <code>part</code> is a component used to build the navigation for the pagination.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.next", "paginate-next" %}
|
||||
|
||||
Returns the <a href="/themes/liquid-documentation/objects/part/">part</a> variable for the <strong>Next</strong> link in the pagination navigation.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
{% if paginate.next.is_link %}
|
||||
<a href="{{ paginate.next.url }}">{{ paginate.next.title }}</a>
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
<!-- If we're not on the last page, and there still needs to be a Next link -->
|
||||
<a href="/collections/all?page=17">Next »</a>
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.previous", "paginate-previous" %}
|
||||
|
||||
Returns the <a href="/themes/liquid-documentation/objects/part/">part</a> variable for the <strong>Previous</strong> link in the pagination navigation.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
{% if paginate.previous.is_link %}
|
||||
<a href="{{ paginate.previous.url }}">{{ paginate.previous.title }}</a>
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>{% highlight html %}{% raw %}
|
||||
<!-- If we're not on the first page, and there still needs to be a Previous link -->
|
||||
<a href="/collections/all?page=15">« Previous</a>
|
||||
{% endraw %}{% endhighlight %}</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.page_size", "paginate-page_size" %}
|
||||
|
||||
Returns the number of items displayed per page.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "paginate.pages", "paginate-pages" %}
|
||||
|
||||
Returns the number of pages created by the pagination tag.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
87
documentation/objects/part.md
Normal file
87
documentation/objects/part.md
Normal file
@@ -0,0 +1,87 @@
|
||||
---
|
||||
layout: default
|
||||
title: part
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# part
|
||||
|
||||
Each <code>part</code> returned by the <a href="/themes/liquid-documentation/objects/paginate/#paginate.parts">paginate.parts</a> array represents a link in the pagination's navigation.
|
||||
|
||||
{% block "note-information" %}
|
||||
The <code>part</code> object is only accessible through the <a href="/themes/liquid-documentation/objects/paginate">paginate</a> object, and can only be used within <a href="/themes/liquid-documentation/tags/theme-tags/#paginate">paginate</a> tags.
|
||||
{% endblock %}
|
||||
|
||||
The example below shows how the <code>part</code> object's attributes can be accessed through a for loop that goes through the <code>paginate.parts</code> array.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for part in paginate.parts %}
|
||||
{% if part.is_link %}
|
||||
{{ part.title | link_to: part.url}}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<a href="/collections/frontpage?page=1" title="">1</a>
|
||||
<a href="/collections/frontpage?page=2" title="">2</a>
|
||||
<a href="/collections/frontpage?page=3" title="">3</a>
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
The <code>part</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "part.is_link", "part-is_link" %}
|
||||
|
||||
Returns <code>true</code> if the part is a link, returns <code>false</code> if it is not.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "part.title", "part-title" %}
|
||||
|
||||
Returns the title of the part.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "part.url", "part-url" %}
|
||||
|
||||
Returns the URL of the part.
|
||||
|
||||
421
documentation/objects/product.md
Normal file
421
documentation/objects/product.md
Normal file
@@ -0,0 +1,421 @@
|
||||
---
|
||||
layout: default
|
||||
title: product
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# product
|
||||
|
||||
The <code>product</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.available", "product-available" %}
|
||||
|
||||
<p>Returns <code>true</code> if a product is available for purchase. Returns <code>false</code>if all of the products variants' <a href="/themes/liquid-documentation/objects/variant/#variant.inventory_quantity">inventory_quantity</a> values are zero or less, and their <a href="/themes/liquid-documentation/objects/variant/#variant.inventory_policy">inventory_policy</a> is not set to "Allow users to purchase this item, even if it is no longer in stock."</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.collections", "product-collections" %}
|
||||
|
||||
<p>Returns an array of all of the <a href="/themes/liquid-documentation/objects/collection/">collections</a> a product belongs to.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
This product belongs in the following collections:
|
||||
|
||||
{% for collection in product.collections %}
|
||||
{{ collection.title }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
This product belongs in the following collections:
|
||||
|
||||
Sale
|
||||
Shirts
|
||||
Spring
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.compare_at_price_max", "product-compare_at_price_max" %}
|
||||
|
||||
<p>Returns the highest <strong>compare at</strong> price. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.compare_at_price_min", "product-compare_at_price_min" %}
|
||||
|
||||
<p>Returns the lowest <strong>compare at</strong> price. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.compare_at_price_varies", "product-compare_at_price_varies" %}
|
||||
|
||||
<p>Returns <code>true</code> if the <code>compare_at_price_min</code> is different from the <code>compare_at_price_max</code>. Returns <code>false</code> if they are the same.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.content", "product-content" %}
|
||||
|
||||
<p>Returns the description of the product. Alias for <a href="#product.description">product.description</a>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.description", "product-description" %}
|
||||
|
||||
<p>Returns the description of the product.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.featured_image", "product-featured_image" %}
|
||||
|
||||
<p>Returns the relative URL of the product's featured <a href="/themes/liquid-documentation/objects/image/">image</a>.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.handle", "product-handle" %}
|
||||
|
||||
Returns the <a href="/themes/liquid-documentation/basics/handle/">handle</a> of a product.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.id", "product-id" %}
|
||||
|
||||
<p>Returns the id of the product.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.images", "product-images" %}
|
||||
|
||||
Returns an array of the product's <a href="/themes/liquid-documentation/objects/image/">images</a>. Use the <a href="/themes/liquid-documentation/filters/url-filters/#product_img_url">product_img_url</a> filter to link to the product image on Shopify's Content Delivery Network.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for image in product.images %}
|
||||
<img src="{{ image.src | product_img_url: 'medium' }}">
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<img src="//cdn.shopify.com/s/files/1/0087/0462/products/shirt14_medium.jpeg?v=1309278311" />
|
||||
<img src="http://cdn.shopify.com/s/files/1/0087/0462/products/nice_shirt_medium.jpeg?v=1331480777">
|
||||
<img src="http://cdn.shopify.com/s/files/1/0087/0462/products/aloha_shirt_medium.jpeg?v=1331481001">
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.options", "product-options" %}
|
||||
|
||||
<p>Returns an array of the product's options.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for option in product.options %}
|
||||
{{ option }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Color Size Material
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
Use <a href="/themes/liquid-documentation/filters/array-filters/#size">size</a> if you need to determine how many options a product has.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ product.options.size }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
3
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.price", "product-price" %}
|
||||
|
||||
<p>Returns the price of the product. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.price_max", "product-price_max" %}
|
||||
|
||||
<p>Returns the highest price of the product. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.price_min", "product-price_min" %}
|
||||
|
||||
<p>Returns the lowest price of the product. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.price_varies", "product-price_varies" %}
|
||||
|
||||
<p>Returns <code>true</code> if the product's variants have varying prices. Returns <code>false</code> if all of the product's variants have the same price.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.tags", "product-tags" %}
|
||||
|
||||
<p>Returns an array of all of the product's tags. The tags are returned in alphabetical order.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for tag in product.tags %}
|
||||
{{ tag }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
new
|
||||
leather
|
||||
sale
|
||||
special
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.template_suffix", "product-template_suffix" %}
|
||||
|
||||
Returns the name of the custom product template assigned to the product, without the <code>product.</code> prefix nor the <code>.liquid</code> suffix. Returns <code>nil</code> if a custom template is not assigned to the product.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- on product.wholesale.liquid -->
|
||||
{{ product.template_suffix }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
wholesale
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.title", "product-title" %}
|
||||
|
||||
<p>Returns the title of the product.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.type", "product-type" %}
|
||||
|
||||
<p>Returns the type of the product.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.url", "product-url" %}
|
||||
|
||||
<p>Returns the relative URL of the product.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ product.url }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
/products/awesome-shoes
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.variants", "product-variants" %}
|
||||
|
||||
<p>Returns an array the product's <a href="/themes/liquid-documentation/objects/variant/">variants</a>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "product.vendor", "product-vendor" %}
|
||||
|
||||
<p>Returns the vendor of the product. </p>
|
||||
|
||||
|
||||
106
documentation/objects/search.md
Normal file
106
documentation/objects/search.md
Normal file
@@ -0,0 +1,106 @@
|
||||
---
|
||||
layout: default
|
||||
title: search
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# search
|
||||
|
||||
The <code>search</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
{% anchor_link "search.performed", "search-performed" %}
|
||||
|
||||
Returns <code>true</code> if an HTML form with the attribute <code>action="/search"</code> was submitted successfully. This allows you to show content based on whether a search was performed or not.
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% if search.performed %}
|
||||
<!-- Show search results -->
|
||||
{% endif %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "search.results", "search-results" %}
|
||||
|
||||
Returns an array of matching search result items. The items in the array can be a:
|
||||
|
||||
- <a href="/themes/liquid-documentation/objects/product/">product</a>,
|
||||
- <a href="/themes/liquid-documentation/objects/article/">article</a>,
|
||||
- <a href="/themes/liquid-documentation/objects/page/">page</a>.
|
||||
|
||||
You can access the attributes of the above three objects through <code>search.results</code>.
|
||||
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for item in search.results %}
|
||||
<h3>{{ item.title | link_to: item.url }}</h3>
|
||||
{% if item.featured_image %}
|
||||
<div class="result-image">
|
||||
<a href="{{ item.url }}" title="{{ item.title | escape }}">
|
||||
{{ item.featured_image.src | product_img_url: 'small' | img_tag: item.featured_image.alt }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
<span>{{ item.content | strip_html | truncatewords: 40 | highlight: search.terms }}</span>
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "search.results_count", "search-results_count" %}
|
||||
|
||||
<p>Returns the number of results found.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "search.terms", "search-terms" %}
|
||||
|
||||
<p>Returns the string that was entered in the search input box. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#highlight">highlight</a> filter to apply a different style to any instances in the search results that match up with <code>search.terms</code>.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ item.content | highlight: search.terms }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- If the search term was "Yellow" -->
|
||||
<strong class="highlight">Yellow</strong> shirts are the best!
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
95
documentation/objects/shipping_method.md
Normal file
95
documentation/objects/shipping_method.md
Normal file
@@ -0,0 +1,95 @@
|
||||
---
|
||||
layout: default
|
||||
title: shipping_method
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# shipping_method
|
||||
|
||||
The <code>shipping_method</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
{% anchor_link "shipping_method.handle", "shipping_method-handle" %}
|
||||
|
||||
Returns the <a href="/themes/liquid-documentation/basics/handle/">handle</a> of the shipping method. The price of the shipping rate is appended to the end of the handle.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shipping_method.handle }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
shopify-international-shipping-25.00
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shipping_method.price", "shipping_method-price" %}
|
||||
|
||||
<p>Returns the price of the shipping method. Use a <a href="/themes/liquid-documentation/filters/money-filters/">money filter</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shipping_method.price | money }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
$15
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shipping_method.title", "shipping_method-title" %}
|
||||
|
||||
Returns the title of the shipping method.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shipping_method.title }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
International Shipping
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
271
documentation/objects/shop.md
Normal file
271
documentation/objects/shop.md
Normal file
@@ -0,0 +1,271 @@
|
||||
---
|
||||
layout: default
|
||||
title: shop
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# shop
|
||||
|
||||
The <code>shop</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.collections_count", "shop-collections_count" %}
|
||||
|
||||
<p>Returns the number of collections in a shop.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.currency", "shop-currency" %}
|
||||
|
||||
<p>Returns the shop's currency in three-letter format (ex: USD).</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.description", "shop-description" %}
|
||||
|
||||
<p>Returns the description of the shop.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.domain", "shop-domain" %}
|
||||
|
||||
<p>Returns the primary domain of the shop.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.email", "shop-email" %}
|
||||
|
||||
<p>Returns the shop's email address.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.enabled_payment_types", "shop-enabled_payment_types" %}
|
||||
|
||||
<p>Returns an array of accepted credit cards for the shop. Use the <a href="/themes/liquid-documentation/filters/url-filters/#payment_type_img_url">payment_type_img_url</a> filter to link to the SVG image file of the credit card.</p>
|
||||
|
||||
The available values for this array are:
|
||||
|
||||
- visa
|
||||
- master
|
||||
- american_express
|
||||
- paypal
|
||||
- jcb
|
||||
- diners_club
|
||||
- maestro
|
||||
- google_wallet
|
||||
- discover
|
||||
- solo
|
||||
- switch
|
||||
- laser
|
||||
- dankort
|
||||
- forbrugsforeningen
|
||||
- dwolla
|
||||
- bitcoin
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.metafields", "shop-metafields" %}
|
||||
|
||||
<p>Returns the shop's metafields. Metafields can only be set using the Shopify API .</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.money_format", "shop-money_format" %}
|
||||
|
||||
<p>Returns a string that is used by Shopify to format money without showing the currency.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.money_with_currency", "shop-money_with_currency" %}
|
||||
|
||||
<p>Returns a string that is used by Shopify to format money while also displaying the currency.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.name", "shop-name" %}
|
||||
|
||||
<p>Returns the shop's name.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.permanent_domain", "shop-permanent_domain" %}
|
||||
|
||||
<p>Returns the <strong>.myshopify.com</strong> URL of a shop.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.products_count", "shop-products_count" %}
|
||||
|
||||
<p>Returns the number of products in a shop.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.types", "shop-types" %}
|
||||
|
||||
<p>Returns an array of all unique product types in a shop.</p>
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product_type in shop.types %}
|
||||
{{ product_type | link_to_type }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.url", "shop-url" %}
|
||||
|
||||
<p>Returns the full URL of a shop.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ shop.url }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
http://johns-apparel.com
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "shop.vendors", "shop-vendors" %}
|
||||
|
||||
<p>Returns an array of all unique vendors in a shop.</p>
|
||||
|
||||
{% highlight html %}{% raw %}
|
||||
{% for product_vendor in shop.vendors %}
|
||||
{{ product_vendor | link_to_vendor }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
140
documentation/objects/tablerow.md
Normal file
140
documentation/objects/tablerow.md
Normal file
@@ -0,0 +1,140 @@
|
||||
---
|
||||
layout: default
|
||||
title: tablerow
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# tablerow
|
||||
|
||||
The <code>tablerow</code> object is used within the <a href="/themes/liquid-documentation/tags/iteration-tags/#tablerow">tablerow</a> tag. It contains attributes of its parent for loop.
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link " tablerow.length", "tablerow-length" %}
|
||||
|
||||
<p>Returns the number of iterations of the <tt>tablerow</tt> loop.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link " tablerow.index", "tablerow-index" %}
|
||||
|
||||
Returns the current index of the <tt>tablerow</tt> loop, starting at 1.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link " tablerow.index0", "tablerow-index0" %}
|
||||
|
||||
Returns the current index of the <tt>tablerow</tt> loop, starting at 0.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link " tablerow.rindex", "tablerow-rindex" %}
|
||||
|
||||
Returns <a href="#tablerow.index">tablerow.index</a> in reverse order.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link " tablerow.rindex0", "tablerow-rindex0" %}
|
||||
|
||||
Returns <a href="#tablerow.index0">tablerow.index0</a> in reverse order.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link " tablerow.first", "tablerow-first" %}
|
||||
|
||||
Returns <code>true</code> if it's the first iteration of the <tt>tablerow</tt> loop. Returns <code>false</code> if it is not the first iteration.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tablerow.last", "tablerow-last" %}
|
||||
|
||||
Returns <code>true</code> if it's the last iteration of the <tt>tablerow</tt> loop. Returns <code>false</code> if it is not the last iteration.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tablerow.col", "tablerow-col" %}
|
||||
|
||||
Returns the index of the current row, starting at 1.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tablerow.col0", "tablerow-col0" %}
|
||||
|
||||
Returns the index of the current row, starting at 0.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tablerow.col_first", "tablerow-col_first" %}
|
||||
|
||||
Returns <code>true</code> if the current column is the first column in a row, returns <code>false</code> if it is not.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link " tablerow.col_last", "tablerow-col_last" %}
|
||||
|
||||
Returns <code>true</code> if the current column is the last column in a row, returns <code>false</code> if it is not.
|
||||
|
||||
|
||||
|
||||
114
documentation/objects/tax_line.md
Normal file
114
documentation/objects/tax_line.md
Normal file
@@ -0,0 +1,114 @@
|
||||
---
|
||||
layout: default
|
||||
title: tax_line
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# tax_line
|
||||
|
||||
The <code>tax_line</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tax_line.title", "tax_line-title" %}
|
||||
|
||||
Returns the title of the tax.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ tax_line.title }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
GST
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tax_line.price", "tax_line-price" %}
|
||||
|
||||
Returns the amount of the tax. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.
|
||||
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ tax_line.price | money }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
€25
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tax_line.rate", "tax_line-rate" %}
|
||||
|
||||
Returns the rate of the tax in decimal notation.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ tax_line.rate }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
0.14
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "tax_line.rate_percentage", "tax_line-rate_percentage" %}
|
||||
|
||||
Returns the rate of the tax in percentage format.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ tax_line.rate_percentage }}%
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
14%
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
37
documentation/objects/template.md
Normal file
37
documentation/objects/template.md
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
layout: default
|
||||
title: template
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# template
|
||||
|
||||
<code>template</code> returns the name of the template used to render the current page, with the <code>.liquid</code> extension omitted.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- If you're on the index.liquid template -->
|
||||
{{ template }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
index
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
79
documentation/objects/theme.md
Normal file
79
documentation/objects/theme.md
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
layout: default
|
||||
title: theme
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# theme
|
||||
|
||||
The <code>theme</code> object contains information about published themes in a shop. You can also use <code>themes</code> to iterate through both themes.
|
||||
|
||||
<p class="input">Input</p>
|
||||
{% highlight html %}{% raw %}
|
||||
{% for t in themes %}
|
||||
{{ t.role }} theme: {{ t.name }}
|
||||
{% endfor %}
|
||||
{% endraw %}{% endhighlight %}
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
mobile theme: minimal
|
||||
main theme: radiance
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
The <code>theme</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "theme.id", "theme-id" %}
|
||||
|
||||
Returns the theme's id. This is useful for when you want to link a user directly to the theme's Theme Settings.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Go to your <a href="/admin/themes/{{ theme.id }}/settings">theme settings</a> to change your logo.
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Go to your <a href="/admin/themes/8196497/settings">theme settings</a> to change your logo.
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "theme.role", "theme-role" %}
|
||||
|
||||
Returns one of the two possible roles of a theme: <code>main</code> or <code>mobile</code>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "theme.name", "theme-name" %}
|
||||
|
||||
Returns the name of the theme.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
122
documentation/objects/transaction.md
Normal file
122
documentation/objects/transaction.md
Normal file
@@ -0,0 +1,122 @@
|
||||
---
|
||||
layout: default
|
||||
title: transaction
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# transaction
|
||||
|
||||
The <code>transaction</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
{% anchor_link "transaction.id", "transaction-id" %}
|
||||
|
||||
Returns the id of the transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "transaction.amount", "transaction-amount" %}
|
||||
|
||||
Returns the amount of the transaction. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "transaction.name", "transaction-name" %}
|
||||
|
||||
Returns the name of the transaction.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ transaction.name }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
c251556901.1
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "transaction.status", "transaction-status" %}
|
||||
|
||||
Returns the status of the transaction.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "transaction.created_at", "transaction-created_at" %}
|
||||
|
||||
<p>Returns the timestamp of when the transaction was created. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#date">date</a> filter to format the timestamp.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "transaction.gateway", "transaction-gateway" %}
|
||||
|
||||
Returns the name of the payment gateway used for the transaction.
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
{{ transaction.gateway }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Cash on Delivery (COD)
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% comment %} not including 'kind' and 'receipt' for now. No info can be found on these {% endcomment %}
|
||||
199
documentation/objects/variant.md
Normal file
199
documentation/objects/variant.md
Normal file
@@ -0,0 +1,199 @@
|
||||
---
|
||||
layout: default
|
||||
title: variant
|
||||
|
||||
nav:
|
||||
group: Liquid Variables
|
||||
---
|
||||
|
||||
# variant
|
||||
|
||||
The <code>variant</code> object has the following attributes:
|
||||
|
||||
<a id="topofpage"></a>
|
||||
{% table_of_contents %}
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.available", "variant-available" %}
|
||||
|
||||
Returns <code>true</code> if the variant is available to be purchased, or <code>false</code> if it not. In order for a variant to be available, its <code>variant.inventory_quantity</code> must be greater than zero and its <code>variant.inventory_policy</code> must be <code>continue</code>.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.barcode", "variant-barcode" %}
|
||||
|
||||
<p>Returns the variant's barcode.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.compare_at_price", "variant-compare_at_price" %}
|
||||
|
||||
<p>Returns the variant's compare at price. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.id", "variant-id" %}
|
||||
|
||||
<p>Returns the variant's unique id.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.inventory_management", "variant-inventory_management" %}
|
||||
|
||||
<p>Returns the variant's inventory tracking service.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.inventory_policy", "variant-inventory_policy" %}
|
||||
|
||||
Returns the string <code>continue</code> if the "Allow users to purchase this item, even if it is no longer in stock." checkbox is checked in the variant options in the Admin. Returns <code>deny</code> if it is unchecked.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.inventory_quantity", "variant-inventory_quantity" %}
|
||||
|
||||
<p>Returns the variant's inventory quantity.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.option1", "variant-option1" %}
|
||||
|
||||
Returns the value of the variant's first option.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.option2", "variant-option2" %}
|
||||
|
||||
Returns the value of the variant's second option.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.option3", "variant-option3" %}
|
||||
|
||||
Returns the value of the variant's third option.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.price", "variant-price" %}
|
||||
|
||||
<p>Returns the variant's price. Use one of the <a href="/themes/liquid-documentation/filters/money-filters/">money filters</a> to return the value in a monetary format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.sku", "variant-sku" %}
|
||||
|
||||
<p>Returns the variant's SKU.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.title", "variant-title" %}
|
||||
|
||||
<p>Returns the concatenation of all the variant's option values, joined by a <code>/</code>.</p>
|
||||
|
||||
<p class="input">Input</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
<!-- If variant's option1, option2, and option3 are "Red", "Small", "Wool", respectively -->
|
||||
{{ variant.title }}
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
<p class="output">Output</p>
|
||||
<div>
|
||||
{% highlight html %}{% raw %}
|
||||
Red / Small / Wool
|
||||
{% endraw %}{% endhighlight %}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% anchor_link "variant.weight", "variant-weight" %}
|
||||
|
||||
<p>Returns the variant's weight. Use the <a href="/themes/liquid-documentation/filters/additional-filters/#weight_with_unit">weight_with_unit</a> filter to convert it to the shop's weight format.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user