Overview
Access Lantern loyalty data in your Shopify themes using the Liquid templating language
Lantern stores all customer loyalty data as Shopify metafields and metaobjects, making it accessible through Shopify's Liquid templating language. This allows you to build custom loyalty experiences directly in your theme.
All data is automatically updated by Lantern and cached for optimal storefront performance.
Available Metafields
The following metafields are available for accessing Lantern data:
Customer Profile
| Field | Description | Example Value |
|---|---|---|
activity_feed | Recent customer activity events | Loyalty actions, purchases, referrals |
birth_date | Customer's birthday | "1989-12-13" |
is_tester | Test account flag | Hide from analytics, enable debug features |
properties | Custom customer properties | {"favorite_category": "electronics"} |
wallet | All available rewards & credits | Active discounts, gift cards, product rewards, store credit balances |
wishlist | Customer's wishlist items | Array of product variant GIDs |
Loyalty Program
| Field | Description | Example Value |
|---|---|---|
loyalty_tier | Current tier name | "Gold" |
loyalty_points | Available points balance | 1250 |
loyalty_spend | Current period spend | 249.99 |
is_eligible | Can participate in loyalty | true |
is_blocked | Blocked from rewards | false |
Referral Program
| Field | Description | Example Value |
|---|---|---|
referral_code | Unique referral code | "6b577dd5288" |
is_advocate | Has referred others | true |
is_referred | Joined through referral | true |
Usage Example
All Lantern metafields are accessed through the customer.metafields object in Liquid. Most use the lantern namespace.
{% assign points = customer.metafields.lantern.loyalty_points %}
{% assign tier = customer.metafields.lantern.loyalty_tier %}
{% if points and tier %}
<div class="loyalty-status">
<h3>Welcome {{ tier | capitalize }} Member!</h3>
<p>You have {{ points }} points available</p>
</div>
{% endif %}Authentication
Metafields are only available for logged-in customers. When a customer is not logged in, all metafields will return null or be undefined.
Learn more about accessing metafields in Liquid on Shopify.