A free shipping offer can encourage shoppers to add a little more to their cart, but customers need to know how close they are to qualifying. A Shopify free shipping progress bar makes that goal clear by updating as cart totals change.
In this guide, you’ll learn how to add a Shopify free shipping progress bar to your cart using Liquid. We’ll cover the basic code and where to place it so the bar can display the remaining amount or celebrate when free shipping is unlocked.
Understand the Shopify free shipping progress bar Liquid approach
Before adding a visual element to the cart, decide what shoppers should be working toward and where they’ll see their progress. Those choices give your Liquid logic a clear target and help the message feel like a useful prompt rather than an interruption.
Start by defining the offer and the wording that will guide shoppers toward it. A consistent threshold and clear message make the progress calculation easier to build and maintain.
Choose a shipping threshold and cart messaging
Set a minimum order amount that matches your store’s shipping policy, such as free standard shipping on orders over $75. Keep the bar’s threshold aligned with the actual shipping rate; otherwise, a shopper could see a celebration message but still be charged for delivery.
In Shopify Liquid, cart totals such as cart.totalprice are represented in cents. Convert your threshold to the same unit before comparing values—for example, $75 becomes 7500. Also decide whether the calculation should account for discounts, excluded products, or specific shipping destinations, since these rules can affect whether the offer applies.
Keep the message short and specific. You might show the remaining amount before the threshold, then switch to a confirmation once it’s reached:
- Below the threshold: “You’re $12 away from free shipping.”
- Threshold reached: “You’ve unlocked free shipping!”
Use your store’s currency formatting when displaying the remaining amount, rather than hard-coding a currency symbol. That helps the Shopify free shipping progress bar Liquid approach work more smoothly across currencies.
Once the offer logic is settled, consider how shoppers move through your cart. Placement affects whether they notice the prompt and can act on it without disrupting checkout.
Decide where the progress bar belongs in your cart
For a full cart page, place the bar near the subtotal or checkout button, where the order total is already in view. In a cart drawer, position it below the item list or near the drawer’s primary action so shoppers can connect the progress message to their next step.
Choose a location that remains visible as cart contents update. If your theme uses AJAX to refresh the cart drawer, the bar’s displayed amount and progress may also need to refresh after an item is added or removed; otherwise, shoppers could see outdated information.
Before implementing the Liquid markup, check how your theme handles empty carts and mobile layouts. A practical placement should:
- Stay readable on narrow screens without crowding cart controls.
- Hide or adapt when the cart is empty.
- Keep the checkout button easy to find.
Add Shopify free shipping progress bar Liquid code to your cart
With the offer and placement decided, the next step is turning that goal into something shoppers can see. A small block of Liquid can calculate the gap, display a message, and fill the bar as the cart total changes.
Insert the Liquid markup and threshold logic
Start with the threshold in cents, then compare it with cart.totalprice. Add the following markup near the subtotal or checkout button in your cart template—for example, in sections/main-cart-footer.liquid or the cart drawer snippet, depending on your theme.
{% raw %}{% assign freeshippingthreshold = 7500 %}
{% assign progress = cart.totalprice | times: 100 | dividedby: freeshippingthreshold %}
{% if progress > 100 %}
{% assign progress = 100 %}
{% endif %}
{% if cart.itemcount > 0 %}
<div class="shipping-progress" role="status"
aria-live="polite"
aria-label="Free shipping progress">
{% if cart.totalprice >= freeshippingthreshold %}
<p>You’ve unlocked free shipping!</p>
{% else %}
{% assign remaining = freeshippingthreshold | minus: cart.totalprice %}
<p>You’re {{ remaining | money }} away from free shipping.</p>
{% endif %}
<div class="shipping-progresstrack">
<div class="shipping-progressfill"
style="width: {{ progress }}%;"></div>
</div>
</div>
{% endif %}{% endraw %}Change 7500 to your threshold in cents, and keep it consistent with your shipping rate. The item-count condition prevents the prompt from appearing in an empty cart; the cap keeps the visual fill at 100% when customers exceed the goal.
Next, style the track and fill to match your theme, then check how the message behaves as the total crosses the threshold. The markup below the message provides the visual indicator, while the currency filter formats the remaining amount using the store’s settings.
Show the remaining spend and update the progress indicator
Give .shipping-progresstrack a visible background, a consistent height, and rounded corners; style .shipping-progressfill with your brand color and a short width transition. This makes progress easy to scan without competing with the checkout button.
Test a cart below the threshold, one exactly at it, and one above it. If your theme refreshes the cart with AJAX, make sure it also re-renders this Liquid markup after items change; otherwise, the displayed amount can become stale. For a polished result, confirm that the bar remains readable on mobile and that its accessible status message updates alongside the visual fill.
Test and customize your Shopify free shipping progress bar Liquid setup
A bar can look perfect in the theme editor and still tell the wrong story once discounts or cart updates come into play. A few targeted checks will help confirm that the message, calculation, and design stay in sync across real shopping scenarios.
Start by checking how the amount used in your calculation behaves as shoppers change their order. The cases below can reveal mismatches between the displayed progress and your shipping rules.
Check cart updates, discounts, and empty-cart behavior
Add and remove products while watching the cart total, remaining amount, and bar fill. Test totals just below, exactly at, and just above the threshold; these boundary cases help catch off-by-one-cent errors and make sure the success message appears at the right time.
Discounts deserve a separate check. If your offer is based on the amount customers pay after product discounts, confirm that cart.totalprice produces the expected progress. If your shipping policy uses a different basis, such as the pre-discount subtotal, adjust the Liquid calculation to match that rule. Remember that shipping is not included in the cart total, so the bar should not count delivery charges toward the threshold.
Also verify that an empty cart hides the prompt and that adding the first item brings it back. For themes with an AJAX cart, test updates without refreshing the page. If the number changes but the bar does not, the cart refresh may need to re-render the progress-bar markup as well.
Once the behavior is reliable, review the presentation with keyboard, screen-reader, and mobile use in mind. Small adjustments here can make the prompt clearer without drawing attention away from checkout.
Refine styling, accessibility, and troubleshooting
Keep the track and fill visually distinct, but use enough contrast for both the bar and its message to remain readable. Check the layout at narrow screen widths, and avoid letting the progress indicator push the checkout button below other important cart details.
The status text should communicate progress in words, not rely on color alone. Since the markup already uses role=”status” and aria-live=”polite”, confirm that assistive technology announces useful updates without repeating the message excessively. If announcements are noisy, consider updating the status only when the cart changes rather than on every theme re-render.
- Wrong remaining amount: Check the threshold’s cents value and whether discounts affect the total.
- Stale bar: Confirm the cart drawer refreshes both the Liquid message and fill width.
- Fill exceeds the track: Keep the percentage capped at 100 and inspect the CSS width rules.
After testing, compare the displayed result with your actual shipping settings. That final check helps ensure the Shopify free shipping progress bar Liquid setup guides shoppers toward an offer they can truly claim.
Turn a shipping incentive into a clearer cart experience
A Shopify free shipping progress bar Liquid setup does more than display a changing total: it helps shoppers understand the offer, see how close they are, and decide what to do next. When the threshold, cart message, and placement match your shipping policy, the prompt feels useful rather than distracting.
Keep the experience dependable by checking how the bar responds to cart changes, discounts, empty carts, and mobile layouts. Clear status messages and accessible styling make the progress easy for more customers to follow, while accurate calculations ensure the reward is genuine.
With the bar in place and tested, your cart can turn free shipping into a simple, motivating next step—and give shoppers a smoother path to checkout.