Threshold progress on your storefront
Show logged-in customers how close they are to their next threshold reward. Copy a snippet into your theme.
When a threshold automation is active, Stork Credit stores each customer's next target on their customer record. Your theme can read it to show "spend $80 more to earn your next $10".
Name in the admin
Next store credit threshold
What it holds
The lifetime spend at which this customer earns their next reward
In Liquid
customer.metafields.stork.next_threshold.value
Drop-in: "spend $X more"
Paste anywhere a logged-in customer will see it — the account page, cart, or a section. Change the three values at the top to match your rule.
{%- assign step = 500 -%}{%- comment -%} your threshold interval {%- endcomment -%}
{%- assign reward = 10 -%}{%- comment -%} your reward amount {%- endcomment -%}
{%- assign cap = 0 -%}{%- comment -%} your maximum threshold, or 0 if none {%- endcomment -%}
{%- assign target = customer.metafields.stork.next_threshold.value | default: step -%}
{%- if customer -%}
{%- assign spent = customer.total_spent | divided_by: 100.0 -%}
{%- assign remaining = target | minus: spent -%}
{%- if cap > 0 and spent >= cap -%}{%- assign remaining = 0 -%}{%- endif -%}
{%- if remaining > 0 -%}
<p>
Spend {{ remaining | times: 100 | money }} more to earn
{{ reward | times: 100 | money }} in store credit.
</p>
{%- endif -%}
{%- endif -%}Drop-in: progress bar
Same thing with a bar showing progress through the current milestone.
step, reward and cap are copies of what's on your rule — nothing links them. Change the rule, change the snippet.
If something looks wrong
Nothing at all
The customer is logged out, has passed your maximum, or has already reached their next milestone and is waiting for the automation's next run.
New customers see nothing
The default filter was dropped from the target line. Customers below their first milestone have no field yet, and the default is what stands in for it.
Numbers 100× out
Keep both conversions: customer.total_spent is in cents, the field is in dollars.
Bar out of step with the reward
step no longer matches the interval on your rule.
A target that never pays
The customer is past your maximum threshold — set cap.
Last updated