QUANTM7 Docs
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

PropertyTypeDescription
customer.idnumberThe unique customer ID
customer.emailstringTheir email address
customer.first_namestringFirst name
customer.last_namestringLast name
customer.namestringFull name (first and last combined)
customer.phonestringPhone number, if set
customer.accepts_marketingbooleantrue if the customer opted in to marketing
customer.has_accountbooleantrue if the customer has an account (always true in storefront context)
customer.languagestringThe customer's language preference

Membership and tiers

Q7 has a built-in customer tier system for B2B and loyalty pricing.

PropertyTypeDescription
customer.tierstringstandard, vip, wholesale, or staff
customer.tax_numberstringVAT or tax registration number (B2B)
customer.date_of_birthstringDate 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.

PropertyTypeDescription
customer.walletnumberCombined gift card and store credit balance
{% if customer.wallet > 0 %}
  <p>Your balance: {{ customer.wallet | money }}</p>
{% endif %}

Orders

PropertyTypeDescription
customer.ordersarrayPast orders, newest first
customer.orders_countnumberTotal number of orders
customer.total_spentnumberLifetime spend in the smallest currency unit
customer.last_orderorderThe 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

PropertyTypeDescription
customer.addressesarrayAll saved addresses
customer.addresses_countnumberThe number of saved addresses
customer.default_addressaddressThe 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

PropertyTypeDescription
customer.tagsarrayTags 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

PropertyTypeDescription
customer.metafieldsobjectCustom data fields for this customer
{% if customer.metafields.custom.loyalty_tier %}
  <p>Loyalty tier: {{ customer.metafields.custom.loyalty_tier }}</p>
{% endif %}

On this page