Customer Info Fields

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.

Products field modal

Templating

If you named your customer info field customerInfo, you would be able to have a craft\commerce\models\Customer object 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 %}