Liquid Template Variables - customer
From Spiffy Stores Knowledge Base
The Liquid template variable customer has the following attributes:
The Customer object is available in order notification objects and in the Checkout Additional Content & Scripts section, as well as in the customer templates.
Contents
- 1 customer.id
- 2 customer.email
- 3 customer.title
- 4 customer.first_name
- 5 customer.last_name
- 6 customer.name
- 7 customer.full_name
- 8 customer.title_option_tags
- 9 customer.default_address
- 10 customer.addresses
- 11 customer.addresses_count
- 12 customer.orders
- 13 customer.orders_count
- 14 customer.recent_order
- 15 customer.total_spent
- 16 customer.new_address
- 17 customer.errors
- 18 customer.credit
- 19 customer.reset_password_token
- 20 accepts_marketing
- 21 customer.wholesale
- 22 customer.metafields
customer.id
Returns the unique internal number of the customer.
This is normally only for internal usage.
customer.email
Returns the email address of the customer.
customer.title
Returns the customer's title, such as 'Mr', 'Mrs', 'Ms', 'Dr' or 'Professor'
customer.first_name
Returns the customer's first name.
customer.last_name
Returns the customer's last name.
customer.name
Returns the customer's name, without a title.
customer.full_name
Returns the customer's name, including the title.
customer.title_option_tags
Returns a set of HTML <option> tags containing the possible set of titles that can be used. These option tags can be wrapped within a <select> tag to create an option drop-down selection for the customer's title.
customer.default_address
Return the customer's default address.
customer.addresses
Return an array of all the customer's addresses.
customer.addresses_count
Return the number of addresses that the customer has.
customer.orders
Return an array of all the customer's orders.
customer.orders_count
Return the number of orders that the customer has placed.
customer.recent_order
customer.total_spent
customer.new_address
customer.errors
customer.credit
customer.reset_password_token
accepts_marketing
Returns true if the customer has indicated that they want to receive marketing emails.
customer.wholesale
Returns true if the customer has wholesale status, and is eligible to purchase products using the wholesale price for the product.
customer.metafields
Return the metafields for the customer.
Metafields can only be managed using the Spiffy Stores API.