4.5 KiB
layout, title, nav
| layout | title | nav | ||
|---|---|---|---|---|
| default | customer |
|
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
Output
{% 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
Output
{% 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
Output
{% 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
Output
{% anchor_link "customer.tags", "customer-tags" %}
Returns the list of tags associated with the customer.
Input
Output
{% anchor_link "customer.total_spent", "customer-total_spent" %}
Returns the total amount spent on all orders.