--- layout: default title: customer nav: group: Liquid Variables --- # customers

The customer object contains information of customers who have created a Customer Account.

customer can also be accessed in order email templates, the Thank You page of the checkout, as well as in apps such as Order Printer.

{% table_of_contents %} {% anchor_link "customer.accepts_marketing", "customer-accepts_marketing" %}

Returns true if the customer accepts marketing, returns false if the customer does not.

{% anchor_link "customer.addresses", "customer-addresses" %} Returns an array of all of the customer addresses associated with a customer. See customer_address for a full list of available attributes.

Input

{% highlight html %}{% raw %} {% for address in customer.addresses %} {{ address.street }} {% endfor %} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} 126 York St, Suite 200 (Shopify Office) 123 Fake St 53 Featherston Lane {% endraw %}{% endhighlight %}
{% anchor_link "customer.addresses_count", "customer-addresses_count" %}

Returns the number of addresses associated with a customer.

{% anchor_link "customer.default_address", "customer-default_address" %}

Returns the default customer_address of a customer.

{% anchor_link "customer.email", "customer-email" %}

Returns the email address of the customer.

{% anchor_link "customer.first_name", "customer-first_name" %}

Returns the first name of the customer.

{% anchor_link "customer.id", "customer-id" %}

Returns the id of the customer.

{% anchor_link "customer.last_name", "customer-last_name" %}

Returns the last name of the customer.

{% anchor_link "customer.last_order", "customer-last_order" %}

Returns the last order placed by the customer.

Input

{% highlight html %}{% raw %} Your last order was placed on: {{ customer.last_order.created_at | date: "%B %d, %Y %I:%M%p" }} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} Your last order was placed on: April 25, 2014 01:49PM {% endraw %}{% endhighlight %}
{% anchor_link "customer.name", "customer-name" %}

Returns the full name of the customer.

{% anchor_link "customer.orders", "customer-orders" %}

Returns an array of all orders placed by the customer.

Input

{% highlight html %}{% raw %} {% for order in customer.orders %} {{ order.id }} {% endfor %} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} #1088 #1089 #1090 {% endraw %}{% endhighlight %}
{% anchor_link "customer.orders_count", "customer-orders_count" %}

Returns the total number of orders a customer has placed.

{% anchor_link "customer.recent_order", "customer-recent_order" %}

Returns the most recent order placed by the customer.

Input

{% highlight html %}{% raw %} Your most recent order was placed on: {{ customer.recent_order.created_at | date: "%B %d, %Y %I:%M%p" }} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} Your last order was placed on: August 25, 2014 05:49PM {% endraw %}{% endhighlight %}
{% anchor_link "customer.tags", "customer-tags" %} Returns the list of tags associated with the customer.

Input

{% highlight html %}{% raw %} {% for tag in customer.tags %} {{ tag }} {% endfor %} {% endraw %}{% endhighlight %}

Output

{% highlight html %}{% raw %} wholesale regular-customer VIP {% endraw %}{% endhighlight %}
{% anchor_link "customer.total_spent", "customer-total_spent" %}

Returns the total amount spent on all orders.