Liquid API
loyalty_tier
Access the current loyalty tier handle for a logged-in customer.
Syntax
customer.metafields.lantern.loyalty_tierDescription
The loyalty_tier metafield contains the customer's current loyalty tier as a string handle. Tiers represent different levels of customer status based on spending, points earned, or other qualifying criteria. This value is automatically updated when customers advance or change tiers.
Tier handles are lowercase, hyphenated strings (e.g., "bronze", "silver", "gold") that correspond to your loyalty program's tier configuration.
Properties
Type: String
Namespace: lantern
Return Values
| Scenario | Value | Type |
|---|---|---|
| Logged in with tier | Tier handle (e.g., "gold") | String |
| Logged in without tier | null | null |
| Not eligible for loyalty | null | null |
| Logged out | null | null |
Examples
Basic Tier Display
{% assign tier = customer.metafields.lantern.loyalty_tier %}
{% if tier %}
<div class="loyalty-tier">
<span class="tier-badge tier-{{ tier }}">
{{ tier | capitalize }} Member
</span>
</div>
{% endif %}Tier-Based Messaging
{% assign tier = customer.metafields.lantern.loyalty_tier %}
{% if tier %}
<div class="tier-welcome">
{% case tier %}
{% when 'bronze' %}
<h3>Welcome Bronze Member! 🥉</h3>
<p>You're earning 1 point per $1 spent.</p>
{% when 'silver' %}
<h3>Welcome Silver Member! 🥈</h3>
<p>You're earning 1.5 points per $1 spent.</p>
{% when 'gold' %}
<h3>Welcome Gold Member! 🥇</h3>
<p>You're earning 2 points per $1 spent plus free shipping!</p>
{% when 'platinum' %}
<h3>Welcome Platinum Member! 💎</h3>
<p>You're earning 3 points per $1 spent plus exclusive access!</p>
{% else %}
<h3>Welcome {{ tier | capitalize }} Member!</h3>
{% endcase %}
</div>
{% endif %}