YOUR PROFESSIONAL WEBSITE FOR $100
In the world of e-commerce, one of the most powerful motivators for a customer is "free shipping." But simply offering it isn't enough. To truly leverage this incentive, you need to turn it into a game—a goal that customers are actively encouraged to reach. The single best way to do this is with a free shipping progress bar on your cart page.
This simple visual tool shows customers exactly how close they are to unlocking free shipping (e.g., "You're only $15 away!"). It's a proven strategy for increasing your store's Average Order Value (AOV) because it encourages customers to add one more item to their cart.
This guide will provide a complete, copy-and-paste tutorial on how to add a free shipping bar to your Shopify store. We'll walk you through editing your theme code to create this powerful conversion tool, a key step in any serious Shopify conversion rate optimization plan.
A Shopify Store with a Modern Theme: This tutorial is designed for any modern Shopify Online Store 2.0 theme, like the popular free "Dawn" theme.
A Free Shipping Rate: You must have a free shipping rate set up in your Shopify admin (Settings > Shipping and delivery). For example, "Free shipping on orders over $50."
First, we need to locate the correct file that controls your cart page.
From your Shopify Admin, go to Online Store > Themes.
Find your current theme, click the three-dots icon, and select Edit code.
In the file list on the left, find the "Sections" folder and click to open it.
Inside this folder, find and click on the file named main-cart-items.liquid. This is the primary file that renders the items in your cart.
Now, we will add the simple HTML structure that will become our progress bar.
Scroll to the very top of the main-cart-items.liquid file. On the first line, before any other code, copy and paste the following HTML snippet:
<div id="free-shipping-bar-container" class="free-shipping-container"> <p id="free-shipping-text" class="free-shipping-text"></p> <div class="progress-bar-outer"> <div id="progress-bar-inner" class="progress-bar-inner"></div> </div> </div>
This creates the container, the text, and the visual bar elements that we will control with CSS and JavaScript.
Next, we need to add the CSS code to make our HTML look like an actual progress bar.
In the file list on the left, find the "Assets" folder.
Inside this folder, find and click on the file named base.css (or sometimes theme.css). This is your theme's main stylesheet.
Scroll to the very bottom of this file and paste the following CSS code:
.free-shipping-container { text-align: center; padding: 15px; margin-bottom: 20px; border: 1px solid #e1e1e1; border-radius: 5px; }
.free-shipping-text { margin-bottom: 10px; font-size: 16px; }
.progress-bar-outer { width: 100%; height: 20px; background-color: #f1f1f1; border-radius: 10px; overflow: hidden; }
.progress-bar-inner { height: 100%; width: 0%; background-color: #4CAF50; /* Green */ border-radius: 10px; transition: width 0.5s ease-in-out; }
Click Save. This code styles the container and creates the outer and inner bars. Now, for the final step that makes it all work.
This is the magic. This script will read your cart's total, calculate how close it is to your free shipping goal, and update the bar and text automatically.
Go back to your main-cart-items.liquid file. Scroll all the way to the bottom. After all the existing code, copy and paste the entire code block below:
<script> document.addEventListener('DOMContentLoaded', function() { // --- IMPORTANT: SET YOUR FREE SHIPPING GOAL HERE --- // The value should be in cents. For $50, use 5000. const freeShippingThreshold = 5000;
// Get the cart total in cents from Shopify's Liquid object const cartTotalInCents = {{ cart.total_price }};
const progressBarInner = document.getElementById('progress-bar-inner'); const freeShippingText = document.getElementById('free-shipping-text'); const container = document.getElementById('free-shipping-bar-container');
if (!progressBarInner || !freeShippingText || !container) { return; // Exit if elements are not on the page }
const amountRemaining = freeShippingThreshold - cartTotalInCents; const currencyFormatter = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' });
if (amountRemaining > 0) { const percentage = (cartTotalInCents / freeShippingThreshold) * 100; progressBarInner.style.width = percentage + '%'; freeShippingText.innerHTML = 'You are ' + currencyFormatter.format(amountRemaining / 100) + ' away from free shipping!'; } else { progressBarInner.style.width = '100%'; progressBarInner.style.backgroundColor = '#4CAF50'; // Green freeShippingText.innerHTML = 'Congratulations! You\\'ve unlocked free shipping!'; } }); </script>
Crucial Step: In the code you just pasted, find the line const freeShippingThreshold = 5000;. You must change 5000 to match your free shipping goal, in cents. If your goal is $75, change it to 7500. If it's $100, change it to 10000.
Click Save.
You've now successfully added a powerful marketing tool to your Shopify cart. This progress bar will engage your customers, reduce cart abandonment, and measurably increase your average order value over time.
While this guide covers one of the most impactful customizations, the possibilities for your Shopify theme are nearly endless. If you're looking for more advanced Shopify theme customization with Liquid, such as creating custom product options, tabs, or a completely bespoke checkout experience, expert help is essential.
For a free, no-pressure consultation on your Shopify project, call me directly at (608) 888-3735.
How to Start a Business in 2025: A 10-Step Checklist
LLC vs. Sole Proprietorship: Which is Right for Your New Business?
How Much Does It Cost to Start a Small Business? (A Realistic Budget Breakdown)
What is a Brand Identity and Why Does Your Business Need One?
A Guide to Starting a Business in Ohio: Local Resources and Registrations
Why Every Small Business Needs a Professional Website in 2025
Domain Name vs. Web Hosting: Understanding the Building Blocks of Your Website
How Much Does a Website Cost? (A Guide to Pricing and Value)
What is a CMS and How Do You Choose the Right One?
What is SEO? A Beginner's Guide to Getting Your Business Found on Google
10 Free Ways to Drive Traffic to Your New Website
A Beginner's Guide to Taking Professional Product Photos with Your Phone
How to Build an Email List: A Guide for Authors and Creatives
5 Common Mistakes to Avoid on Your 'About Us' Page
What is a Call to Action (CTA)? Examples That Convert Visitors into Customers
Copyright © 2014 - 2025 JeremyDoesWebsites.com All rights reserved.
Our Privacy Policy Our Cookies Policy Our Terms of Use