customer - aareano/ifshop-wiki GitHub Wiki

This drop is corresponds to Shopify's.

missing properties

none

additional properties

  • customer.note
  • customer.state
  • customer.tax_exempt


customer.accepts_marketing

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


customer.addresses

Returns an array of all addresses associated with a customer. See customer_address for a full list of available attributes.

Input

{% for address in customer.addresses %}
  {{ address.street }}
{% endfor %}

Output

126 York St, Suite 200 (Shopify Office)
123 Fake St
53 Featherston Lane

customer.addresses_count

Returns the number of addresses associated with a customer.


customer.default_address

Returns the default customer_address.


customer.email

Returns the email address of the customer.


customer.first_name

Returns the first name of the customer.


customer.has_account

Returns true if the email associated with an order is also tied to a customer account. Returns false if it is not. Helpful in email templates. In the theme, that will always be true.


customer.id

Returns the id of the customer.


customer.last_name

Returns the last name of the customer.


customer.last_order

Returns the last order placed by the customer, not including test orders.

Input

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

Output

Your last order was placed on: April 25, 2014 01:49PM

customer.name

Returns the full name of the customer.


customer.note

Returns the note for the customer.


customer.orders

Returns an array of all orders placed by the customer.

Input

{% for order in customer.orders %}
{{ order.id }}
{% endfor %}

Output

#1088
#1089
#1090

customer.orders_count

Returns the total number of orders a customer has placed.


customer.shop

Defined for the following events:

  • a customer is created
  • a customer is deleted
  • a customer is disabled
  • a customer is enabled
  • a customer is updated

Returns the shop drop.


customer.state

Returns the state of the customer's account in a shop. Valid states are:

  • disabled: customers are disabled by default until they are invited. Staff accounts can disable a customer's account at any time.
  • invited: the customer has been emailed an invite to create an account that saves their customer settings.
  • enabled: the customer accepted the email invite and created an account.
  • declined: the customer declined the email invite to create an account.

customer.tags

Returns the list of tags associated with the customer.

Input

{% for tag in customer.tags %}
{{ tag }}
{% endfor %}

Output

wholesale regular-customer VIP

customer.tax_exempt

Returns the true if the customer is tax exempt, otherwise false.


customer.total_spent

Returns the total amount spent on all orders.