Customer Variables


Variable Usage
customer.shippingAddresses Returns the shipping address collection for the customer.
{{ customer.shippingAddresses }} 
customer.billingAddresses Returns the billing address collection for the customer (an alias of customer.billingAddress).
{{ customer.billingAddresses }} 
customer.customerGroups Returns a collection of customer groups associated with the customer.
{{ customer.customerGroups }}
customer.email Returns the email address for the customer.
{{ customer.email }}
customer.first_name Returns the first name for the customer
{{ customer.first_name }}
customer.last_name Returns the last name for the customer.
{{ customer.last_name }}
customer.orders Returns a collection of orders associated with the customer.
{{ customer.orders }}
customer.accepts_marketing Returns a 0 or 1 to indicate whether or not the customer accepts marketing emails. A translate() helper has been created to make this output more human friendly.
{{ customer.accepts_marketing }}

\LemonStand\Backend\Html::translate($customer->accepts_marketing)
customer.order_count Returns the number of orders associated with the customer.
{{ customer.order_count }}
customer.getCustomFieldsArray() Returns array of key/value pairs from configured custom fields.
{{ customer.getCustomFieldsArray() }}
customer.subscriptions Returns a collection of subscriptions associated with the customer
{% for subscription in customer.subscriptions %}
  {{ subscription.billingPlan }}
{% endfor %}
customer.cards Returns a collection of saved cards for the customer (currently in beta, premium plans only).
{% for card in customer.cards %}
    {# Do... #}
{% endfor %}
customer.hasCards() Returns true if a customer has stored cards, false if not (currently in beta, premium plans only).
{% if customer.hasCards() %}
    {% for card in customer.cards %}
        {# Do... #}
    {% endfor %}
{% endfor %}
customer.default_card Returns the default stored card for the customer (currently in beta, premium plans only).
{{ customer.default_card }}
customer.default_billing_address Returns the default billing address for a customer.
{{ customer.default_billing_address }}
customer.default_shipping_address Returns the default shipping address for a customer.
{{ customer.default_shipping_address }}
customer.hasBillingAddresses() Returns true if the customer has billing addresses.
{% if customer.hasBillingAddresses() %}
    {% for address in customer.billingAddresses%}
        {# Do... #}
    {% endfor %}
{% endfor %}
customer.hasShippingAddresses() Returns true if the customer has shipping addresses.
{% if customer.hasShippingAddresses() %}
    {% for address in customer.shippingAddresses%}
        {# Do... #}
    {% endfor %}
{% endfor %}
customer.subscriptionAddresses() Returns the subscription address collection for the customer.
{% for address in customer.subscriptionAddresses%}
    {# Do... #}
{% endfor %}
customer.hasSubscriptionAddresses() Returns true if the customer has subscription addresses.
{% if customer.hasSubscriptionAddresses() %}
    {% for address in customer.subscriptionAddresses %}
        {# Do... #}
    {% endfor %}
{% endfor %}