QuillObjects
Customer
The customer object for logged-in visitor details, orders, and addresses.
The customer object holds data about the logged-in visitor. When no one is logged in, customer is nil. Always check for this before using its properties.
{% if customer %}
<p>Welcome back, {{ customer.first_name }}!</p>
{% else %}
<a href="/account/login">Log in</a>
{% endif %}Core properties
| Property | Type | Description |
|---|---|---|
customer.id | number | The unique customer ID |
customer.email | string | Their email address |
customer.first_name | string | First name |
customer.last_name | string | Last name |
customer.name | string | Full name (first and last combined) |
customer.phone | string | Phone number, if set |
customer.accepts_marketing | boolean | true if the customer opted in to marketing |
customer.has_account | boolean | true if the customer has an account (always true in storefront context) |
customer.language | string | The customer's language preference |
Membership and tiers
Q7 has a built-in customer tier system for B2B and loyalty pricing.
| Property | Type | Description |
|---|---|---|
customer.tier | string | standard, vip, wholesale, or staff |
customer.tax_number | string | VAT or tax registration number (B2B) |
customer.date_of_birth | string | Date of birth, if set |
{% if customer.tier == 'wholesale' %}
<p>Trade pricing applied to your account.</p>
{% elsif customer.tier == 'vip' %}
<p>Welcome, VIP member.</p>
{% endif %}Wallet
The wallet combines gift card balances and store credit into a single amount.
| Property | Type | Description |
|---|---|---|
customer.wallet | number | Combined gift card and store credit balance |
{% if customer.wallet > 0 %}
<p>Your balance: {{ customer.wallet | money }}</p>
{% endif %}Orders
| Property | Type | Description |
|---|---|---|
customer.orders | array | Past orders, newest first |
customer.orders_count | number | Total number of orders |
customer.total_spent | number | Lifetime spend in the smallest currency unit |
customer.last_order | order | The most recent order |
<p>You have placed {{ customer.orders_count }} {{ customer.orders_count | pluralize: 'order', 'orders' }}.</p>
<p>Total spent: {{ customer.total_spent | money }}</p>Order history
{% for order in customer.orders %}
<div class="order-row">
<span>{{ order.name }}</span>
<span>{{ order.created_at | date: '%d %B %Y' }}</span>
<span>{{ order.total_price | money }}</span>
</div>
{% endfor %}Addresses
| Property | Type | Description |
|---|---|---|
customer.addresses | array | All saved addresses |
customer.addresses_count | number | The number of saved addresses |
customer.default_address | address | The default shipping address |
See the Address object for all address fields.
{% if customer.default_address %}
<p>
{{ customer.default_address.address1 }}<br />
{{ customer.default_address.city }},
{{ customer.default_address.zip }}<br />
{{ customer.default_address.country }}
</p>
{% endif %}Tags
| Property | Type | Description |
|---|---|---|
customer.tags | array | Tags assigned to this customer in the admin |
Tags are useful for showing content to specific groups of customers:
{% if customer.tags contains 'wholesale' %}
<p>Your trade discount has been applied.</p>
{% endif %}Metafields
| Property | Type | Description |
|---|---|---|
customer.metafields | object | Custom data fields for this customer |
{% if customer.metafields.custom.loyalty_tier %}
<p>Loyalty tier: {{ customer.metafields.custom.loyalty_tier }}</p>
{% endif %}