For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Customers who haven't reached their first milestone are included. They have no field yet, so the snippet falls back to your first threshold — a customer who has spent $120 against a $500 interval is correctly told they need $380 more. This matches how the automation treats them.

If something looks wrong

What you see
Why

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.

The Cart widget and Checkout widget only show what the current cart will earn from order-value automations, so threshold rewards never appear there. For the same progress shown at checkout instead of in your theme, add the dedicated Threshold widget (Shopify Plus only) — see Cart & checkout widgets.

Your theme reads the customer record at page load, so a customer who just ordered can look further along than the automation has processed. Run history is the record of what was actually issued.

Last updated