Shopify Free Shipping Progress Bar: Full Liquid, CSS and Schema Code
A ready-to-use free shipping progress bar for the cart or cart drawer, with a threshold setting, remaining amount and smooth progress bar.
Share with Shopify developers — useful guides spread faster in theme dev communities.
What you get
A section that tells shoppers how much more they need to spend for free shipping. The merchant sets the threshold and messages in the theme editor.
sections/free-shipping-bar.liquid
{%- liquid
assign threshold = section.settings.threshold | times: 100
assign progress = 0
if threshold > 0
assign progress = cart.total_price | times: 100.0 | divided_by: threshold | round
endif
if progress > 100
assign progress = 100
endif
assign remaining = threshold | minus: cart.total_price
-%}
<div class="fsb" data-fsb>
<p class="fsb__text">
{%- if threshold > 0 and remaining > 0 -%}
{{ section.settings.text_before | escape }} <strong>{{ remaining | money }}</strong> {{ section.settings.text_after | escape }}
{%- elsif threshold > 0 -%}
{{ section.settings.message_success | escape }}
{%- endif -%}
</p>
<div class="fsb__track" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="{{ progress }}">
<div class="fsb__bar" style="width: {{ progress }}%"></div>
</div>
</div>
CSS and schema
{% style %}
#shopify-section-{{ section.id }} .fsb { padding: 12px 16px; background: #f8fafc; border-radius: 10px; }
#shopify-section-{{ section.id }} .fsb__text { margin: 0 0 8px; font-size: 14px; text-align: center; }
#shopify-section-{{ section.id }} .fsb__track { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
#shopify-section-{{ section.id }} .fsb__bar { height: 100%; background: #0f766e; transition: width .4s ease; }
{% endstyle %}
{% schema %}
{
"name": "Free shipping bar",
"settings": [
{ "type": "number", "id": "threshold", "label": "Free shipping threshold", "default": 50, "info": "In your store currency" },
{ "type": "text", "id": "text_before", "label": "Text before amount", "default": "You are only" },
{ "type": "text", "id": "text_after", "label": "Text after amount", "default": "away from free shipping" },
{ "type": "text", "id": "message_success", "label": "Success message", "default": "You have unlocked free shipping!" }
],
"presets": [{ "name": "Free shipping bar" }]
}
{% endschema %}
Keep it updated in a cart drawer
The bar renders on the server, so refresh it after cart changes. When you call cart/add.js or cart/change.js, ask for this section in the same request with the sections parameter and replace the bar's HTML with the returned markup. The AJAX request code is in Shopify AJAX Cart API Examples.
Limits to know
- The threshold is compared with the cart total in the shopper's currency. Stores with multiple currencies should set thresholds per market or rely on shipping rates.
- The bar is only a message. Free shipping itself must be configured in Shipping and delivery settings.
Takeaway
Paste the section, set the threshold and place it in the cart. Learn the drawer basics in the cart drawer implementation guide.
Try it with our free tools
Paste your HTML into the HTML to Liquid converter to generate a section with schema, or pick a layout from Ready Sections. Questions? Use the contact form.
Topic cluster
Theme Development
Dawn, performance, images, and production theme workflows.
Convert your HTML to Shopify Liquid
Paste a module, generate Liquid + schema, then copy the result into your theme. Free to try—no signup required for a sample conversion.
Share
Share this guide
Found this guide useful? Share it with other Shopify developers on LinkedIn, X, or Reddit.