Customer Info Fields
This document is for a version of Craft Commerce that is no longer supported. Please refer to the latest version →
# General
The Customer Info field allows you to add Commerce related customer information to the Craft user field layout. This allows you to see the past orders for a customer as well as all addresses they have in their address book.
# Templating
If you named your customer info field customerInfo
you would be able to have a Customer model returned for a user like so:
{% set customer = user.customerInfo %}
Example of getting the customers addresses:
{% for address in user.customerInfo.addresses %}
{{ address.firstName }}<br>
{% endfor %}
Example of getting the customers past orders:
{% for order in user.customerInfo.orders %}
{{ order.number }}<br>
{% endfor %}