Difference between revisions of "Liquid Template Variables - shop"

From Spiffy Stores Knowledge Base

Line 14: Line 14:
  
 
<pre>{{ shop.name }}</pre>
 
<pre>{{ shop.name }}</pre>
 +
 +
== <code>shop.description</code> ==
 +
 +
Returns a string with the shop's description. This value can be configured on the "General Settings" page, under the "Preferences" tab.
 +
 +
If your theme includes the standard headers as follows, then this description will automatically appear in the header tags of your home page.
 +
 +
<pre>{% include 'headers' %}</pre>
 +
 +
You may use this variable to build a meta description tag for your home page manually if you prefer.
 +
 +
Example usage:
 +
 +
<pre>{% if template == 'index' and shop.description != '' %}
 +
<meta name="description" content="{{ shop.description }}" />{% endif %}
 +
</pre>
  
 
== <code>shop.owner</code> ==
 
== <code>shop.owner</code> ==

Revision as of 20:13, 29 August 2013

The liquid template variable shop has the following attributes:

shop.id

Returns the unique internal shop id number.

This is normally only for internal usage.

shop.name

Returns a string with the shop's name.

Example usage:

{{ shop.name }}

shop.description

Returns a string with the shop's description. This value can be configured on the "General Settings" page, under the "Preferences" tab.

If your theme includes the standard headers as follows, then this description will automatically appear in the header tags of your home page.

{% include 'headers' %}

You may use this variable to build a meta description tag for your home page manually if you prefer.

Example usage:

{% if template == 'index' and shop.description != '' %}
<meta name="description" content="{{ shop.description }}" />{% endif %}

shop.owner

Returns a string with the name of the shop's owner.

Example usage:

Dear {{ shop.owner }}, you have received a new order!

shop.currency

Returns a string with the name of the currency that this shop uses. This is usually a three character representation (e.g. AUD).

Example usage:

All prices are in {{ shop.currency }}

shop.country

Returns the printable name of the country in which the shop is located.

This shop is located in {{ shop.country }}

shop.country_iso

Returns the two character ISO country code for the shop.

{% if shop.country_iso == 'AU' %}GST is applicable to this shop{% endif %}

shop.tax_number

Returns the taxation number for the shop, if required by local legislation.

This is usually an ABN (Australia), GST Number (New Zealand) or VAT Registration (Europe).

TAX INVOICE {{ shop.tax_number }}

shop.url

Returns the full URL for your shop.

Note: The value depends upon the primary address configured under Preferences -> DNS & Domains.

shop.domain

Returns the domain of your shop.

Note: The value depends upon the primary address configured under Preferences -> DNS & Domains.

shop.products

Returns all the products in the shop.

shop.products_count

Returns the number of products in the shop.

Example usage:

{{ shop.products_count }} {{ shop.products_count | pluralize: 'product', 'products' }} are available

shop.collections

Returns all the collections in the shop.

shop.collections_count

Returns the number of collections in the shop.

shop.all_collections

Returns all of the shop's collections without pagination.

shop.money_with_currency_format

Return the currency formatting string which includes the currency symbol.

shop.money_format

Return the currency formatting string excluding the currency symbol.

shop.types

Returns a list of all unique product types in the store. An array of types is returned.

Example usage:

<ul>
{% for product_type in shop.types %}
  <li>
    {{ product_type | link_to_type }}
  </li>
{% endfor %}
</ul>

shop.vendors

Returns a list of all unique product vendors in the store. An array of vendors is returned.

Example usage:

<ul>
{% for product_vendor in shop.vendors %}
  <li>
    {{ product_vendor | link_to_vendor }}
  </li>
{% endfor %}
</ul>