Skip to content

Free Shipping Progress Bar for Shopify

A Shopify section with a progress bar showing how far the cart is from free shipping, kept in sync with cart changes, with empty, below and reached messages.

Also known as: free shipping bar, cart progress bar, free shipping threshold bar, free delivery progress

Preview with sample data

Open in new tab

Liquid code

A free shipping progress bar for Shopify, delivered as one self-contained section file. It tells shoppers how much more they need to spend to reach your free shipping threshold, and it updates when the cart changes, without a page reload. Add it near the top of a page or on the cart page.

How it works

The section first renders from the cart object in Liquid, so the correct message is in the page before any script runs. It has three states: an empty cart, a cart below the threshold and a cart that has reached it. A check icon and the reached color appear once the threshold is met.

The script then listens for cart changes. It watches fetch calls to the /cart/add, /cart/change, /cart/update and /cart/clear endpoints, listens for a list of common theme cart events and refreshes when the tab becomes visible again. Each time, it reads /cart.js and redraws every bar on the page.

For shoppers using another currency, the threshold is converted with the store's exchange rate and rounded up, so the bar never claims free shipping too early. The panel stays hidden until the script has that rate, so a wrong amount is never shown.

Customization

All settings are in the theme editor:

  • Free shipping threshold: the amount in your base currency, for example 75 or 49.99.
  • Message below the threshold, Message when reached and Message for an empty cart: [amount] becomes the amount still to spend, or the threshold in the other two messages.
  • Show the bar when the cart is empty: turn it off to reveal the bar only after the first item is added.
  • Background, Text, Accent, Accent when reached and Bar track: the colors.
  • Side padding, Top padding and Bottom padding: the spacing around the bar.

Use cases

  • Stores with a free shipping threshold: show how much more shoppers need to spend to qualify
  • Cart pages: update the bar when items change without a page reload
  • Home page headers: place the bar near the top of a page to promote your shipping offer
  • Shops raising order value: use separate empty, below-threshold and reached messages to nudge shoppers

Accessibility

The bar uses role="progressbar" with aria-valuenow and aria-valuetext, so its value is available as a sentence. Changes are announced through a polite live region, and the announcement is cleared when the bar hides. The fill animation is removed under prefers-reduced-motion.

Usage notes

The section requires an Online Store 2.0 theme. It only displays progress: you must also set up the matching free shipping rate under Settings > Shipping and delivery, and the bar does not check that rate. It compares the threshold with the cart total, so a shipping rate with different conditions can disagree with it.

Live updates cover themes that use fetch or send one of the listed events. A theme that changes the cart in another way may only show the new amount after the next page load. A threshold of 0 or an empty one hides the bar, with a notice in the editor only.

The preview uses sample data: the store, products and cart are invented, and a small demo control stands in for /cart.js, which the preview cannot reach. The photos in the preview are from Unsplash; section.liquid contains none.

Free Shipping Progress Bar for Shopify at a glance

Framework
Shopify
Code
Liquid
JavaScript
Not needed
Dependencies
None
Layout
Responsive, works on mobile
Category
Shopping Carts
License
Free for personal and commercial use

Questions about this section

Can I use the Free Shipping Progress Bar for Shopify code for free?

Yes. You can copy or download the Liquid code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my Shopify store?

Create a new section named shopify-free-shipping-bar in your theme code editor, paste the Liquid code and save. Then add the section to a page in the theme editor. It works with Online Store 2.0 themes.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

How to install

  1. In your Shopify admin, go to Online Store > Themes, open the theme's menu and choose Edit code.
  2. Under Sections, add a new section named shopify-free-shipping-bar, replace its contents with the Liquid code above and save.
  3. Open the theme editor, choose Add section and add it to the page.

Requires an Online Store 2.0 theme. Try it on a copy of your theme first. WebDevSnippets is not affiliated with or endorsed by Shopify.

Free Shipping Progress Bar for Shopify – Shopify shopping carts component screenshot
Free Shipping Progress Bar for Shopify · Shopify Shopping Carts

More Shopping Carts

Mini Cart Dropdown – Bootstrap 5 shopping carts preview

Mini Cart Dropdown

Bootstrap 5 navbar mini cart dropdown with quantity steppers, remove buttons, free-shipping progress, live subtotal and checkout button.

Cart with Saved for Later Section – Bootstrap 5 shopping carts preview

Cart with Saved for Later Section

Bootstrap 5 cart page with product photos, quantity selects, a saved for later list and a live order summary with free-shipping progress.

Shopping Cart Page – Tailwind CSS shopping carts preview

Shopping Cart Page

Tailwind CSS shopping cart with quantity steppers, remove buttons, free shipping progress bar, promo code field and a live-updating order summary.