Variables

Variables are the individual pieces of data about different aspects of your store. You can use these variables in your code to display specific information.

Artist

These variables are only available if you have Artists enabled on the Store > Settings page of your admin area.

artist.id

Returns the id of an artist.

artist.name

Returns the name of an artist.

artist.permalink

Returns the permalink of an artist.

artist.url

Returns the URL of an artist.

View <a href="{{ artist.url }}">my artist</a>
artist.products

Returns all of the products of an artist.

        {% for product in artist.products %}
          <p>{{ product.name }}</p>
        {% endfor %}
      
artists.all

Returns all of the artists in your store.

        {% for artist in artists.all %}
          <p>{{ artist.name }}</p>
        {% endfor %}
      
artists.active

Returns all of the artists that are currently in use by one or more products.

        {% for artist in artists.active %}
          <p>{{ artist.name }}</p>
        {% endfor %}
      
artists.permalink

Returns a specific artist based on it’s permalink.

<a href="{{ artists.rick-astley.url }}">Rick roll</a>

Cart

cart.item_count

Returns the number of items in the cart.

You have {{ cart.item_count | pluralize: 'item', 'items' }} in your cart
cart.price (DEPRECATED)

cart.price is now deprecated, please use cart.subtotal. Returns the combined price for all items in your cart.

Your total price is {{ cart.price | money_with_sign }}
cart.subtotal

Returns the combined price for all items in your cart, before shipping, tax, or discounts.

Your subtotal is {{ cart.subtotal | money_with_sign }}
cart.total

Returns the combined price, shipping, tax, and discounts for all items in your cart.

Your total is {{ cart.total | money_with_sign }}
cart.items

Returns all of the items in your cart.

        {% for item in cart.items %}
          <p>{{ item.name }}</p>
        {% endfor %}
      
cart.country

Returns the country the items are to be shipped. Only applicable if you have country based shipping.

Shipping to {{ cart.country.name }}
cart.shipping.enabled

Returns true of false based on whether the items in your cart are using Big Cartel’s shipping features.

        {% if cart.shipping.enabled %}
          Shipping: {{ cart.shipping.amount | money_with_sign }}
        {% end %}
      
cart.shipping.strict

Returns true of false based on whether the items in your cart have specific shipping rates for different countries.

        {% if cart.shipping.strict %}
          Shipping is strict, ask for country
        {% else %}
          Shipping is global, let them checkout
        {% end %}
      
cart.shipping.pending

Returns true of false based on whether your cart has strict shipping and customer user has selected their country.

        {% if cart.shipping.pending %}
          Please select your country
        {% else %}
          Click here to checkout
        {% end %}
      
cart.shipping.amount

Returns the combined shipping amounts for all items in your cart.

Your shipping total is {{ cart.shipping.amount | money_with_sign }}
cart.discount.enabled

Returns true of false based on whether your store has discount codes.

        {% if cart.discount.enabled %}
          Please enter your discount code
        {% end %}
      
cart.discount.pending

Returns true of false based on whether your user has entered a discount code or not.

        {% if cart.discount.pending %}
          You have entered code {{ cart.discount.code }}
        {% else %}
          Please enter your discount code
        {% end %}
      
cart.discount.name

Returns the name of the discount your customer is using.

You’re getting our "{{ cart.discount.name }}" discount!
cart.discount.amount

Returns the amount your customer is saving by using the discount code.

You’re saving {{ cart.discount.amount | money_with_sign }}
cart.discount.code

Returns the discount code your customer is using.

You entered discount code {{ cart.discount.code }}
cart.discount.type

Returns the type of discount that your customer is using: percent_discount, flat_rate_discount, free_shipping

cart.discount.percent_discount

Returns the true or false depending on whether your customer is using a percentage-off discount.

cart.discount.flat_rate_discount

Returns the true or false depending on whether your customer is using a flat-rate discount.

cart.discount.free_shipping

Returns the true or false depending on whether your customer is using a free shipping discount.

cart.discount.percent

Returns the discount percentage your customer is saving if they’re using a percentage-off discount, blank otherwise.

You’re getting {{ cart.discount.percent }}% off

Cart Item

item.id

Returns the id of an item.

item.name

Returns the name of an item. This is done by combining the name of the product and name of the option, unless it’s a default option.

item.price

Returns the price of an item multiplied by it’s quantity.

{{ item.name }} x {{ item.quantity }} = {{ item.price | money_with_sign }}
item.unit_price

Returns the price of for one of an item.

Each costs {{ item.unit_price | money_with_sign }}
item.shipping

Returns the shipping amount of an item, if you’re using Big Cartel’s shipping features.

Shipping: {{ item.shipping | money_with_sign }}
item.total

Returns the total price and shipping amount of an item.

Total: {{ item.total | money_with_sign }}
item.quantity

Returns the quantity in the cart for an item.

You are ordering {{ item.quantity }} of these
item.product

Returns the product of an item.

You are ordering {{ item.product.name }}
item.option

Returns the option of an item.

You selected this color {{ item.option.name }}

Category

category.id

Returns the id of a category.

category.name

Returns the name of a category.

category.permalink

Returns the permalink of a category.

category.url

Returns the URL of a category.

View <a href="{{ category.url }}">my category</a>
category.products

Returns all of the products of a category.

        {% for product in category.products %}
          <p>{{ product.name }}</p>
        {% endfor %}
      
categories.all

Returns all of the categories in your store.

        {% for category in categories.all %}
          <p>{{ category.name }}</p>
        {% endfor %}
      
categories.active

Returns all of the categories that are currently in use by one or more products.

        {% for category in categories.active %}
          <p>{{ category.name }}</p>
        {% endfor %}
      
categories.permalink

Returns a specific category based on it’s permalink.

<a href="{{ categories.tees.url }}">View tees</a>

Contact

contact.name

Returns the name entered in the contact form.

contact.email

Returns the email address entered in the contact form.

contact.subject

Returns the subject entered in the contact form.

contact.message

Returns the message entered in the contact form.

contact.captcha

Returns a unique captcha to fight spam for the contact form.

contact.sent

Returns true of false based on whether the the contact form was successfully sent.

        {% if contact.sent %}
          Your email has been sent
        {% else %}
          Please fill out the fields below
        {% end %}
      

Country

country.name

Returns the name of a country.

country.code

Returns the code of a country.

Image

image.url

Returns the URL of an image.

<img src="{{ image.url }}" />
image.width

Returns the width of an image.

image.height

Returns the height of an image.

Page

page.id

Returns the id of a page.

page.name

Returns the name of a page.

page.category

Returns the type of page. "custom" or "theme"

page.permalink

Returns the permalink of a page.

page.url

Returns the URL of a page.

View <a href="{{ page.url }}">my page</a>
page.full_url

Returns the absolute URL of a page.

page.full_path

Returns the path as well as any query parameters of the page.

page.meta_description

A unique description for a page to be used in a meta tag.

<meta name="description" content="{{ page.meta_description }}" />
page.meta_keywords

Automatically generated keywords for a page to be used in a meta tag.

<meta name="keywords" content="{{ page.meta_keywords }}" />
pages.all

Returns all of the custom pages in your store.

        {% for page in pages.all %}
          <p>{{ page.name }}</p>
        {% endfor %}
      
pages.permalink

Returns a specific page based on it’s permalink.

<a href="{{ pages.about-us.url }}">About Us</a>

Product

product.id

Returns the id of a product.

product.name

Returns the name of a product.

product.permalink

Returns the permalink of a product.

product.url

Returns the URL of a product.

View <a href="{{ product.url }}">my product</a>
product.edit_url

Returns the URL to edit a product in the admin.

{% if store.logged_in %}<a href="{{ product.edit_url }}">Edit</a>{% endif %}
product.position

Returns the position of a product in your product list.

product.description

Returns the description of a product.

product.status

Returns the status of a product. "active", "sold-out", or "coming-soon"

product.created_at

Returns the date the product was first created.

product.categories

Returns all of the categories of a product.

        <ul>
          {% for category in product.categories %}
          <li>{{ category | link_to }}</li>
          {% endfor %}
        </ul>
      
product.artists

Returns all of the artists of a product.

        <ul>
          {% for artist in product.artists %}
          <li>{{ artist | link_to }}</li>
          {% endfor %}
        </ul>
      
product.css_class

Returns the css_class of a product. "product", "product sold", "product soon", or "product sale"

product.price (DEPRECATED)

Returns the price of a product.
Deprecated: See product.default_price below

{{ product.price | money_with_sign }}
product.default_price

Returns the default price of a product.

{{ product.default_price | money_with_sign }}
product.variable_pricing

Returns true if any option has a price that differs from the default price, false otherwise.

        {% if product.variable_pricing %}
          Starting at {{ product.min_price | money_with_sign }}
        {% else %}
          {{ product.default_price | money_with_sign }}
        {% endif %}
      
product.min_price

Returns the minimum price of a product and it’s options.

{{ product.min_price | money_with_sign }}
product.max_price

Returns the maximum price of a product and it’s options.

{{ product.max_price | money_with_sign }}
product.on_sale

Returns true of false based on whether the product is marked as on sale.

        {% if product.on_sale %}
          On sale!
        {% else %}
          Regular price.
        {% end %}
      
product.has_default_option

Returns true of false based on whether the product has a default option.

        {% unless product.has_default_option %}
          Please select your option
        {% end %}
      
product.option

Returns the default option of a product.

product.options

Returns all of the options of a product whether they are sold out or not.

        {% for option in product.options %}
          <p>{{ option.name }}</p>
        {% endfor %}
      
product.options_in_stock

Returns all of the options of a product that are in stock. If you’re not using Big Cartel’s inventory tracking, then this is the same as calling product.options.

        {% for option in product.options_in_stock %}
          <p>{{ option.name }}</p>
        {% endfor %}
      
product.shipping

Returns all of the shipping areas of a product.

        {% for area in product.shipping %}
          <p>{{ area | shipping_name }}</p>
        {% endfor %}
      
product.image

Returns the default image of a product.

product.images

Returns all of the images of a product.

        {% for image in product.images %}
          <img src="{{ image | product_image_url size:"thumb" }}" />
        {% endfor %}
      
product.image_count

Returns the number of images a product has.

product.previous_product

Return the previous product in your list.

{{ product.previous_product | link_to: "< Back" }}
product.next_product

Return the next product in your list.

{{ product.next_product | link_to: "Next >" }}
products.all

Returns all of the products in your store.

        {% for product in products.all %}
          <p>{{ product.name }}</p>
        {% endfor %}
      
products.current

Returns all of the products for the current Products page.

        {% for product in products.current %}
          <p>{{ product.name }}</p>
        {% endfor %}
      
products.on_sale

Returns all of the products in your store that are marked "on sale".

        {% for product in products.on_sale %}
          <p>{{ product.name }}</p>
        {% endfor %}
      
products.top_selling (DEPRECATED)

Deprecated: products.top_selling is now deprecated. Please use

        {% get products from products.all order:'sales' %}
      

or

        {% paginate products in products.all order:'sales' %}
      

Returns the top 5 selling products in your store

        {% for product in products.top_selling %}
          <p>{{ product.name }}</p>
        {% endfor %}
      
products.newest (DEPRECATED)

Deprecated: products.newest is now deprecated. Please use

        {% get products from products.all order:'newest' %}
      

or

        {% paginate products in products.all order:'newest' %}
      

Returns the 5 newest products in your store

        {% for product in products.newest %}
          <p>{{ product.name }}</p>
        {% endfor %}
      
products.featured (DEPRECATED)

Deprecated: products.featured is now deprecated. Please use

        {% get products from products.all limit:theme.featured_limit order:theme.featured_order %}
      

or

        {% paginate products in products.all limit:theme.featured_limit order:theme.featured_order %}
      
products.permalink

Returns a specific product based on it’s permalink.

<a href="{{ products.new-cd.url }}">View our new cd</a>

Product Option

option.id

Returns the id of an option.

option.name

Returns the name of an option.

option.price

Returns the price of the product option, if set, or the price of the parent product.

{{ option.price | money_with_sign }}
option.has_custom_price

Returns true if this product option has a price set that’s different than the parent product, false otherwise.

        {% if option.has_custom_price %}
          {{ option.price | money_with_sign }}
        {% endif %}
      
option.position

Returns the position of an option in a product’s option list.

option.sold

Returns the number of times an option has been sold.

option.sold_out

Returns true of false based on whether the option is sold out. If you’re not using Big Cartel’s inventory tracking, then this is always true.

        {% if option.sold_out %}
          Sold out!
        {% else %}
          Buy now!
        {% end %}
      
option.quantity

Returns the quantity left in stock for an option.

option.inventory

Returns the remaining inventory percentage of an option. Learn how this is calculated »

{{ option.inventory }}% left in stock
option.default

Returns true of false based on whether the option is the product’s default option.

Product Shipping Area

area.name

Returns the name of a shipping area. Must be used with the shipping_name filter.

{{ area | shipping_name }}
area.amount_alone

Returns the shipped alone amount of a shipping area.

{{ area.amount_alone | money_with_sign }}
area.amount_with_others

Returns the with others amount of a shipping area.

{{ area.amount_with_others | money_with_sign }}
area.country

Returns the country of a shipping area. Only applicable if you have country based shipping.

Shipping for {{ area.country.name }}

Store

store.name

Returns the name of your store. Set on the Store > Settings page of the admin.

store.description

Returns the description of your store. Set on the Store > Settings page of the admin.

store.url

Returns the URL of your store. Set on the Store > Settings page of the admin. This will use your custom domain if you have it setup.

View my <a href="{{ store.url }}">my store</a>
store.website

Returns the URL of your store’s primary website. Set on the Store > Settings page of the admin.

View my <a href="{{ store.website }}">my website</a>
store.currency.name

Returns the name of the currency used for your store. Currency is set on the Store > Settings page of the admin.

store.currency.code

Returns the code of the currency used for your store. Currency is set on the Store > Settings page of the admin.

store.currency.sign

Returns the sign of the currency used for your store. Currency is set on the Store > Settings page of the admin.

store.country

Returns the country of your store. Set on the Store > Settings page of the admin.

We are based in {{ store.country.name }}
store.logged_in

Returns true or false based on whether you’re currently logged into the admin.

{% if store.logged_in %}<a href="{{ product.edit_url }}">Edit</a>{% endif %}

Theme

Each default theme has its own set of pre-defined variables to access images, colors, fonts, and options. These variables are then used throughout the theme to give it unique styling and layout options. To see the available variables for a given theme, simply visit the design area, choose that theme on the Themes pane, and then download the theme code on the Advanced pane.

Still have a question? Check out our questions forum or contact our support team.