Liquid API
is_blocked
Check if a customer is blocked from participating in the loyalty program.
Syntax
customer.metafields.lantern.is_blockedDescription
The is_blocked metafield indicates whether a customer has been blocked from participating in the loyalty program. This boolean value prevents customers from earning points, redeeming rewards, or accessing loyalty benefits. Customers can be blocked for various reasons including fraud prevention, terms of service violations, or administrative actions.
Properties
Type: Boolean
Namespace: lantern
Return Values
| Scenario | Value | Type |
|---|---|---|
| Customer is blocked | true | Boolean |
| Customer is not blocked | false | Boolean |
| Block status not determined | null | null |
| Logged out | null | null |
Examples
Basic Block Check
{% assign is_blocked = customer.metafields.lantern.is_blocked %}
{% if is_blocked %}
<div class="loyalty-blocked alert alert-warning">
<h4>Loyalty Program Access Restricted</h4>
<p>Your loyalty account has been temporarily restricted. Please contact customer service for assistance.</p>
<a href="/pages/contact" class="btn btn-secondary">Contact Support</a>
</div>
{% else %}
{% comment %} Show normal loyalty features {% endcomment %}
{% assign points = customer.metafields.lantern.loyalty_points %}
{% if points %}
<div class="loyalty-status">
<p>Available Points: {{ points }}</p>
</div>
{% endif %}
{% endif %}